diff --git a/eng/swagger_to_sdk_config.json b/eng/swagger_to_sdk_config.json index 5e6fcfcc9c1a..4229a47f83f5 100644 --- a/eng/swagger_to_sdk_config.json +++ b/eng/swagger_to_sdk_config.json @@ -2,7 +2,13 @@ "$schema": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/documentation/sdkautomation/SwaggerToSdkConfigSchema.json", "generateOptions": { "generateScript": { - "path": "pwsh ./eng/scripts/Invoke-GenerateAndBuildV2.ps1" + "path": "pwsh ./eng/scripts/Invoke-GenerateAndBuildV2.ps1", + "stderr": { + "showInComment": "Build succeeded" + }, + "stdout": { + "showInComment": "Autorest" + } } }, "initOptions": { 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 8d727d948569..6858b5ef87a9 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/api/Azure.ResourceManager.ServiceLinker.netstandard2.0.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/api/Azure.ResourceManager.ServiceLinker.netstandard2.0.cs @@ -1,65 +1,13 @@ namespace Azure.ResourceManager.ServiceLinker { - public partial class LinkerResource : Azure.ResourceManager.ArmResource - { - public static readonly Azure.Core.ResourceType ResourceType; - protected LinkerResource() { } - public virtual Azure.ResourceManager.ServiceLinker.LinkerResourceData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string linkerName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetConfigurations(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetConfigurationsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ServiceLinker.Models.LinkerResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ServiceLinker.Models.LinkerResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Validate(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ValidateAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class LinkerResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected LinkerResourceCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string linkerName, Azure.ResourceManager.ServiceLinker.LinkerResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string linkerName, Azure.ResourceManager.ServiceLinker.LinkerResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class LinkerResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public LinkerResourceData() { } - public Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo AuthInfo { get { throw null; } set { } } - public Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? ClientType { get { throw null; } set { } } - public string ProvisioningState { get { throw null; } } - public string Scope { get { throw null; } set { } } - public Azure.Core.ResourceIdentifier SecretStoreKeyVaultId { get { throw null; } set { } } - public Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? SolutionType { get { throw null; } set { } } - public Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo TargetService { get { throw null; } set { } } - 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 static partial class ServiceLinkerExtensions { - public static Azure.ResourceManager.ServiceLinker.LinkerResource GetLinkerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.Response GetLinkerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Response GetLinkerResource(this Azure.ResourceManager.ArmResource armResource, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetLinkerResourceAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetLinkerResourceAsync(this Azure.ResourceManager.ArmResource armResource, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.ServiceLinker.LinkerResourceCollection GetLinkerResources(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } - public static Azure.ResourceManager.ServiceLinker.LinkerResourceCollection GetLinkerResources(this Azure.ResourceManager.ArmResource armResource) { throw null; } + public static Azure.Response GetConfigurationsLinker(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetConfigurationsLinkerAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetLinkers(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetLinkersAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ArmOperation ValidateLinker(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, Azure.WaitUntil waitUntil, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> ValidateLinkerAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, Azure.WaitUntil waitUntil, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.ServiceLinker.Mocking @@ -67,29 +15,34 @@ namespace Azure.ResourceManager.ServiceLinker.Mocking public partial class MockableServiceLinkerArmClient : Azure.ResourceManager.ArmResource { protected MockableServiceLinkerArmClient() { } - public virtual Azure.ResourceManager.ServiceLinker.LinkerResource GetLinkerResource(Azure.Core.ResourceIdentifier id) { throw null; } - 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 partial class MockableServiceLinkerArmResource : Azure.ResourceManager.ArmResource - { - protected MockableServiceLinkerArmResource() { } - public virtual Azure.Response GetLinkerResource(string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - 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 virtual Azure.Response GetConfigurationsLinker(Azure.Core.ResourceIdentifier scope, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConfigurationsLinkerAsync(Azure.Core.ResourceIdentifier scope, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetLinkers(Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetLinkersAsync(Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation ValidateLinker(Azure.Core.ResourceIdentifier scope, Azure.WaitUntil waitUntil, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ValidateLinkerAsync(Azure.Core.ResourceIdentifier scope, Azure.WaitUntil waitUntil, string linkerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.ServiceLinker.Models { 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.AzureKeyVaultProperties AzureKeyVaultProperties(bool? doesConnectAsKubernetesCsiDriver = default(bool?)) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.AzureResourceInfo AzureResourceInfo(Azure.Core.ResourceIdentifier id = null, Azure.ResourceManager.ServiceLinker.Models.AzureResourceBaseProperties resourceProperties = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.ConfluentBootstrapServerInfo ConfluentBootstrapServerInfo(string endpoint = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.ConfluentSchemaRegistryInfo ConfluentSchemaRegistryInfo(string endpoint = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.KeyVaultSecretReferenceSecretInfo KeyVaultSecretReferenceSecretInfo(string name = null, string version = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.KeyVaultSecretUriSecretInfo KeyVaultSecretUriSecretInfo(string value = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerResource LinkerResource(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.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.RawValueSecretInfo RawValueSecretInfo(string value = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.SecretAuthInfo SecretAuthInfo(string name = null, Azure.ResourceManager.ServiceLinker.Models.SecretBaseInfo secretInfo = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.ServicePrincipalCertificateAuthInfo ServicePrincipalCertificateAuthInfo(string clientId = null, System.Guid principalId = default(System.Guid), string certificate = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.ServicePrincipalSecretAuthInfo ServicePrincipalSecretAuthInfo(string clientId = null, System.Guid principalId = default(System.Guid), string secret = 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.SourceConfigurationResult SourceConfigurationResult(System.Collections.Generic.IEnumerable configurations = null) { throw null; } + public static Azure.ResourceManager.ServiceLinker.Models.UserAssignedIdentityAuthInfo UserAssignedIdentityAuthInfo(string clientId = null, string subscriptionId = null) { throw null; } } public abstract partial class AuthBaseInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -102,8 +55,8 @@ protected AuthBaseInfo() { } } public partial class AzureKeyVaultProperties : Azure.ResourceManager.ServiceLinker.Models.AzureResourceBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public AzureKeyVaultProperties() { } - public bool? DoesConnectAsKubernetesCsiDriver { get { throw null; } set { } } + internal AzureKeyVaultProperties() { } + public bool? DoesConnectAsKubernetesCsiDriver { get { throw null; } } Azure.ResourceManager.ServiceLinker.Models.AzureKeyVaultProperties 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.AzureKeyVaultProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -121,9 +74,9 @@ protected AzureResourceBaseProperties() { } } public partial class AzureResourceInfo : Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public AzureResourceInfo() { } - public Azure.Core.ResourceIdentifier Id { get { throw null; } set { } } - public Azure.ResourceManager.ServiceLinker.Models.AzureResourceBaseProperties ResourceProperties { get { throw null; } set { } } + internal AzureResourceInfo() { } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.AzureResourceBaseProperties ResourceProperties { get { throw null; } } Azure.ResourceManager.ServiceLinker.Models.AzureResourceInfo 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.AzureResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -132,8 +85,8 @@ public AzureResourceInfo() { } } public partial class ConfluentBootstrapServerInfo : Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ConfluentBootstrapServerInfo() { } - public string Endpoint { get { throw null; } set { } } + internal ConfluentBootstrapServerInfo() { } + public string Endpoint { get { throw null; } } Azure.ResourceManager.ServiceLinker.Models.ConfluentBootstrapServerInfo 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.ConfluentBootstrapServerInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -142,8 +95,8 @@ public ConfluentBootstrapServerInfo() { } } public partial class ConfluentSchemaRegistryInfo : Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ConfluentSchemaRegistryInfo() { } - public string Endpoint { get { throw null; } set { } } + internal ConfluentSchemaRegistryInfo() { } + public string Endpoint { get { throw null; } } Azure.ResourceManager.ServiceLinker.Models.ConfluentSchemaRegistryInfo 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.ConfluentSchemaRegistryInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -152,9 +105,9 @@ public ConfluentSchemaRegistryInfo() { } } public partial class KeyVaultSecretReferenceSecretInfo : Azure.ResourceManager.ServiceLinker.Models.SecretBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public KeyVaultSecretReferenceSecretInfo() { } - public string Name { get { throw null; } set { } } - public string Version { get { throw null; } set { } } + internal KeyVaultSecretReferenceSecretInfo() { } + public string Name { get { throw null; } } + public string Version { get { throw null; } } Azure.ResourceManager.ServiceLinker.Models.KeyVaultSecretReferenceSecretInfo 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.KeyVaultSecretReferenceSecretInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -163,8 +116,8 @@ public KeyVaultSecretReferenceSecretInfo() { } } public partial class KeyVaultSecretUriSecretInfo : Azure.ResourceManager.ServiceLinker.Models.SecretBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public KeyVaultSecretUriSecretInfo() { } - public string Value { get { throw null; } set { } } + internal KeyVaultSecretUriSecretInfo() { } + public string Value { get { throw null; } } Azure.ResourceManager.ServiceLinker.Models.KeyVaultSecretUriSecretInfo 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.KeyVaultSecretUriSecretInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -202,6 +155,7 @@ public KeyVaultSecretUriSecretInfo() { } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Dotnet { get { throw null; } } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Go { get { throw null; } } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Java { get { throw null; } } + public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType KafkaSpringBoot { get { throw null; } } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Nodejs { get { throw null; } } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType None { get { throw null; } } public static Azure.ResourceManager.ServiceLinker.Models.LinkerClientType Php { get { throw null; } } @@ -218,21 +172,21 @@ public KeyVaultSecretUriSecretInfo() { } public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.LinkerClientType left, Azure.ResourceManager.ServiceLinker.Models.LinkerClientType right) { throw null; } public override string ToString() { throw null; } } - public partial class LinkerResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class LinkerResource : Azure.ResourceManager.Models.ResourceData, 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 { } } + internal LinkerResource() { } + public Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo AuthInfo { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.LinkerClientType? ClientType { get { throw null; } } public string ProvisioningState { get { throw null; } } - public string Scope { get { throw null; } set { } } - public Azure.Core.ResourceIdentifier SecretStoreKeyVaultId { get { throw null; } set { } } - public Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? SolutionType { get { throw null; } set { } } - public Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo TargetService { get { throw null; } set { } } - 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) { } - Azure.ResourceManager.ServiceLinker.Models.LinkerResourcePatch 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 string Scope { get { throw null; } } + public Azure.Core.ResourceIdentifier SecretStoreKeyVaultId { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.VnetSolutionType? SolutionType { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo TargetService { get { throw null; } } + Azure.ResourceManager.ServiceLinker.Models.LinkerResource 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.LinkerResource 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 { @@ -288,8 +242,8 @@ internal LinkerValidationResultItemInfo() { } } public partial class RawValueSecretInfo : Azure.ResourceManager.ServiceLinker.Models.SecretBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public RawValueSecretInfo() { } - public string Value { get { throw null; } set { } } + internal RawValueSecretInfo() { } + public string Value { get { throw null; } } Azure.ResourceManager.ServiceLinker.Models.RawValueSecretInfo 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.RawValueSecretInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -298,9 +252,9 @@ public RawValueSecretInfo() { } } public partial class SecretAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public SecretAuthInfo() { } - public string Name { get { throw null; } set { } } - public Azure.ResourceManager.ServiceLinker.Models.SecretBaseInfo SecretInfo { get { throw null; } set { } } + internal SecretAuthInfo() { } + public string Name { get { throw null; } } + public Azure.ResourceManager.ServiceLinker.Models.SecretBaseInfo SecretInfo { get { throw null; } } Azure.ResourceManager.ServiceLinker.Models.SecretAuthInfo 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.SecretAuthInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -318,10 +272,10 @@ protected SecretBaseInfo() { } } 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 System.Guid PrincipalId { get { throw null; } set { } } + internal ServicePrincipalCertificateAuthInfo() { } + public string Certificate { get { throw null; } } + public string ClientId { get { throw null; } } + public System.Guid PrincipalId { get { throw null; } } 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) { } Azure.ResourceManager.ServiceLinker.Models.ServicePrincipalCertificateAuthInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -330,10 +284,10 @@ public ServicePrincipalCertificateAuthInfo(string clientId, System.Guid principa } public partial class ServicePrincipalSecretAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ServicePrincipalSecretAuthInfo(string clientId, System.Guid principalId, string secret) { } - public string ClientId { get { throw null; } set { } } - public System.Guid PrincipalId { get { throw null; } set { } } - public string Secret { get { throw null; } set { } } + internal ServicePrincipalSecretAuthInfo() { } + public string ClientId { get { throw null; } } + public System.Guid PrincipalId { get { throw null; } } + public string Secret { get { throw null; } } 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) { } Azure.ResourceManager.ServiceLinker.Models.ServicePrincipalSecretAuthInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -363,7 +317,7 @@ internal SourceConfigurationResult() { } } public partial class SystemAssignedIdentityAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public SystemAssignedIdentityAuthInfo() { } + internal SystemAssignedIdentityAuthInfo() { } 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) { } Azure.ResourceManager.ServiceLinker.Models.SystemAssignedIdentityAuthInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -381,9 +335,9 @@ protected TargetServiceBaseInfo() { } } public partial class UserAssignedIdentityAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public UserAssignedIdentityAuthInfo() { } - public string ClientId { get { throw null; } set { } } - public string SubscriptionId { get { throw null; } set { } } + internal UserAssignedIdentityAuthInfo() { } + public string ClientId { get { throw null; } } + public string SubscriptionId { get { throw null; } } 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) { } Azure.ResourceManager.ServiceLinker.Models.UserAssignedIdentityAuthInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/samples/Generated/Samples/Sample_LinkerResource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/samples/Generated/Samples/Sample_LinkerResource.cs deleted file mode 100644 index 9b68c70adeb2..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/samples/Generated/Samples/Sample_LinkerResource.cs +++ /dev/null @@ -1,166 +0,0 @@ -// 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; - -namespace Azure.ResourceManager.ServiceLinker.Samples -{ - public partial class Sample_LinkerResource - { - // Link - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_Link() - { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/Link.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 - 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 - LinkerResource result = await linkerResource.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}"); - } - - // DeleteLink - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DeleteLink() - { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/DeleteLink.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 - 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 - await linkerResource.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // PatchLink - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_PatchLink() - { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PatchLink.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 - 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 - 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 linkerResource.UpdateAsync(WaitUntil.Completed, patch); - 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}"); - } - - // ValidateLinkSuccess - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Validate_ValidateLinkSuccess() - { - // 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. - - // 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}"); - } - - // GetConfiguration - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetConfigurations_GetConfiguration() - { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/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 - 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 - SourceConfigurationResult result = await linkerResource.GetConfigurationsAsync(); - - Console.WriteLine($"Succeeded: {result}"); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/samples/Generated/Samples/Sample_LinkerResourceCollection.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/samples/Generated/Samples/Sample_LinkerResourceCollection.cs deleted file mode 100644 index e6fc68244a46..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/samples/Generated/Samples/Sample_LinkerResourceCollection.cs +++ /dev/null @@ -1,291 +0,0 @@ -// 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; - -namespace Azure.ResourceManager.ServiceLinker.Samples -{ - public partial class Sample_LinkerResourceCollection - { - // LinkList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_LinkList() - { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/LinkList.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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ArmResource created on azure - // for more information of creating ArmResource, please refer to the document of ArmResource - - // get the collection of this LinkerResource - string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; - ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - LinkerResourceCollection collection = client.GetLinkerResources(scopeId); - - // invoke the operation and iterate over the result - await foreach (LinkerResource 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"); - } - - // Link - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_Link() - { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/Link.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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ArmResource created on azure - // for more information of creating ArmResource, please refer to the document of ArmResource - - // get the collection of this LinkerResource - string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; - ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - LinkerResourceCollection collection = client.GetLinkerResources(scopeId); - - // invoke the operation - string linkerName = "linkName"; - LinkerResource result = await collection.GetAsync(linkerName); - - // 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}"); - } - - // Link - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_Link() - { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/Link.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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ArmResource created on azure - // for more information of creating ArmResource, please refer to the document of ArmResource - - // get the collection of this LinkerResource - string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; - ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - LinkerResourceCollection collection = client.GetLinkerResources(scopeId); - - // invoke the operation - string linkerName = "linkName"; - bool result = await collection.ExistsAsync(linkerName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Link - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_Link() - { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/Link.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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ArmResource created on azure - // for more information of creating ArmResource, please refer to the document of ArmResource - - // get the collection of this LinkerResource - string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; - ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - LinkerResourceCollection collection = client.GetLinkerResources(scopeId); - - // invoke the operation - string linkerName = "linkName"; - NullableResponse response = await collection.GetIfExistsAsync(linkerName); - LinkerResource 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}"); - } - } - - // PutLink - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_PutLink() - { - // Generated from example definition: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PutLink.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); - - // this example assumes you already have this ArmResource created on azure - // for more information of creating ArmResource, please refer to the document of ArmResource - - // get the collection of this LinkerResource - string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; - ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - LinkerResourceCollection collection = client.GetLinkerResources(scopeId); - - // 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 RawValueSecretInfo() - { - 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}"); - } - - // PutLinkWithSecretStore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - 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); - - // this example assumes you already have this ArmResource created on azure - // for more information of creating ArmResource, please refer to the document of ArmResource - - // get the collection of this LinkerResource - string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; - ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - LinkerResourceCollection collection = client.GetLinkerResources(scopeId); - - // 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.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}"); - } - - // PutLinkWithServiceEndpoint - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - 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); - - // this example assumes you already have this ArmResource created on azure - // for more information of creating ArmResource, please refer to the document of ArmResource - - // get the collection of this LinkerResource - string resourceUri = "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app"; - ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - LinkerResourceCollection collection = client.GetLinkerResources(scopeId); - - // 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, - }; - 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}"); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ArmServiceLinkerModelFactory.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ArmServiceLinkerModelFactory.cs index 7dde325c0c3a..1554c4894a7a 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ArmServiceLinkerModelFactory.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/ArmServiceLinkerModelFactory.cs @@ -16,7 +16,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models /// Model factory for models. public static partial class ArmServiceLinkerModelFactory { - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -24,22 +24,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. /// connection scope in source service. - /// 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) + /// A new instance for mocking. + public static LinkerResource LinkerResource(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) { - return new LinkerResourceData( + return new LinkerResource( id, name, resourceType, @@ -54,36 +54,6 @@ public static LinkerResourceData LinkerResourceData(ResourceIdentifier id = null serializedAdditionalRawData: null); } - /// 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. - 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) - { - return new LinkerResourcePatch( - targetService, - authInfo, - clientType, - provisioningState, - solutionType != null ? new VnetSolution(solutionType, serializedAdditionalRawData: null) : null, - secretStoreKeyVaultId != null ? new LinkerSecretStore(secretStoreKeyVaultId, serializedAdditionalRawData: null) : null, - scope, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// Validated linker id. /// Validation operation status. @@ -150,5 +120,109 @@ public static SourceConfiguration SourceConfiguration(string name = null, string { return new SourceConfiguration(name, value, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The Id of azure resource. + /// + /// The azure resource connection related properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// A new instance for mocking. + public static AzureResourceInfo AzureResourceInfo(ResourceIdentifier id = null, AzureResourceBaseProperties resourceProperties = null) + { + return new AzureResourceInfo(TargetServiceType.AzureResource, serializedAdditionalRawData: null, id, resourceProperties); + } + + /// Initializes a new instance of . + /// True if connect via Kubernetes CSI Driver. + /// A new instance for mocking. + public static AzureKeyVaultProperties AzureKeyVaultProperties(bool? doesConnectAsKubernetesCsiDriver = null) + { + return new AzureKeyVaultProperties(AzureResourceType.KeyVault, serializedAdditionalRawData: null, doesConnectAsKubernetesCsiDriver); + } + + /// Initializes a new instance of . + /// The endpoint of service. + /// A new instance for mocking. + public static ConfluentBootstrapServerInfo ConfluentBootstrapServerInfo(string endpoint = null) + { + return new ConfluentBootstrapServerInfo(TargetServiceType.ConfluentBootstrapServer, serializedAdditionalRawData: null, endpoint); + } + + /// Initializes a new instance of . + /// The endpoint of service. + /// A new instance for mocking. + public static ConfluentSchemaRegistryInfo ConfluentSchemaRegistryInfo(string endpoint = null) + { + return new ConfluentSchemaRegistryInfo(TargetServiceType.ConfluentSchemaRegistry, serializedAdditionalRawData: null, endpoint); + } + + /// Initializes a new instance of . + /// The actual value of the secret. + /// A new instance for mocking. + public static RawValueSecretInfo RawValueSecretInfo(string value = null) + { + return new RawValueSecretInfo(LinkerSecretType.RawValue, serializedAdditionalRawData: null, value); + } + + /// Initializes a new instance of . + /// Name of the Key Vault secret. + /// Version of the Key Vault secret. + /// A new instance for mocking. + public static KeyVaultSecretReferenceSecretInfo KeyVaultSecretReferenceSecretInfo(string name = null, string version = null) + { + return new KeyVaultSecretReferenceSecretInfo(LinkerSecretType.KeyVaultSecretReference, serializedAdditionalRawData: null, name, version); + } + + /// Initializes a new instance of . + /// URI to the keyvault secret. + /// A new instance for mocking. + public static KeyVaultSecretUriSecretInfo KeyVaultSecretUriSecretInfo(string value = null) + { + return new KeyVaultSecretUriSecretInfo(LinkerSecretType.KeyVaultSecretUri, serializedAdditionalRawData: null, value); + } + + /// Initializes a new instance of . + /// Username or account name for secret auth. + /// + /// Password or key vault secret for secret auth. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// A new instance for mocking. + public static SecretAuthInfo SecretAuthInfo(string name = null, SecretBaseInfo secretInfo = null) + { + return new SecretAuthInfo(LinkerAuthType.Secret, serializedAdditionalRawData: null, name, secretInfo); + } + + /// Initializes a new instance of . + /// Client Id for userAssignedIdentity. + /// Subscription id for userAssignedIdentity. + /// A new instance for mocking. + public static UserAssignedIdentityAuthInfo UserAssignedIdentityAuthInfo(string clientId = null, string subscriptionId = null) + { + return new UserAssignedIdentityAuthInfo(LinkerAuthType.UserAssignedIdentity, serializedAdditionalRawData: null, clientId, subscriptionId); + } + + /// Initializes a new instance of . + /// ServicePrincipal application clientId for servicePrincipal auth. + /// Principal Id for servicePrincipal auth. + /// Secret for servicePrincipal auth. + /// A new instance for mocking. + public static ServicePrincipalSecretAuthInfo ServicePrincipalSecretAuthInfo(string clientId = null, Guid principalId = default, string secret = null) + { + return new ServicePrincipalSecretAuthInfo(LinkerAuthType.ServicePrincipalSecret, serializedAdditionalRawData: null, clientId, principalId, secret); + } + + /// Initializes a new instance of . + /// Application clientId for servicePrincipal auth. + /// Principal Id for servicePrincipal auth. + /// ServicePrincipal certificate for servicePrincipal auth. + /// A new instance for mocking. + public static ServicePrincipalCertificateAuthInfo ServicePrincipalCertificateAuthInfo(string clientId = null, Guid principalId = default, string certificate = null) + { + return new ServicePrincipalCertificateAuthInfo(LinkerAuthType.ServicePrincipalCertificate, serializedAdditionalRawData: null, clientId, principalId, certificate); + } } } 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..7202b92c305a 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 _linkerClientDiagnostics; + private LinkerRestOperations _linkerRestClient; + /// Initializes a new instance of the class for mocking. protected MockableServiceLinkerArmClient() { @@ -31,94 +37,245 @@ internal MockableServiceLinkerArmClient(ArmClient client) : this(client, Resourc { } + private ClientDiagnostics LinkerClientDiagnostics => _linkerClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ServiceLinker", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private LinkerRestOperations LinkerRestClient => _linkerRestClient ??= new LinkerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private string GetApiVersionOrNull(ResourceType resourceType) { TryGetApiVersion(resourceType, out string apiVersion); return apiVersion; } - /// Gets a collection of LinkerResources in the ArmClient. + /// + /// Returns list of Linkers which connects to the resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers + /// + /// + /// Operation Id + /// Linker_List + /// + /// + /// Default Api Version + /// 2022-05-01 + /// + /// + /// /// The scope that the resource will apply against. - /// An object representing collection of LinkerResources and their operations over a LinkerResource. - public virtual LinkerResourceCollection GetLinkerResources(ResourceIdentifier scope) + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetLinkersAsync(ResourceIdentifier scope, CancellationToken cancellationToken = default) { - return new LinkerResourceCollection(Client, scope); + Argument.AssertNotNull(scope, nameof(scope)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => LinkerRestClient.CreateListRequest(scope); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LinkerRestClient.CreateListNextPageRequest(nextLink, scope); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => LinkerResource.DeserializeLinkerResource(e), LinkerClientDiagnostics, Pipeline, "MockableServiceLinkerArmClient.GetLinkers", "value", "nextLink", cancellationToken); } /// - /// Returns Linker resource for a given name. + /// Returns list of Linkers which connects to the resource. /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers /// /// /// Operation Id - /// Linker_Get + /// Linker_List /// /// /// Default Api Version /// 2022-05-01 /// + /// + /// + /// 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 GetLinkers(ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => LinkerRestClient.CreateListRequest(scope); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LinkerRestClient.CreateListNextPageRequest(nextLink, scope); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => LinkerResource.DeserializeLinkerResource(e), LinkerClientDiagnostics, Pipeline, "MockableServiceLinkerArmClient.GetLinkers", "value", "nextLink", cancellationToken); + } + + /// + /// Validate a link. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker + /// /// - /// Resource - /// + /// Operation Id + /// Linker_Validate + /// + /// + /// Default Api Version + /// 2022-05-01 /// /// /// /// The scope that the resource will apply against. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The name Linker resource. /// The cancellation token to use. - /// is null. /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetLinkerResourceAsync(ResourceIdentifier scope, string linkerName, CancellationToken cancellationToken = default) + /// or is null. + public virtual async Task> ValidateLinkerAsync(ResourceIdentifier scope, WaitUntil waitUntil, string linkerName, CancellationToken cancellationToken = default) { - return await GetLinkerResources(scope).GetAsync(linkerName, cancellationToken).ConfigureAwait(false); + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); + + using var scope0 = LinkerClientDiagnostics.CreateScope("MockableServiceLinkerArmClient.ValidateLinker"); + scope0.Start(); + try + { + var response = await LinkerRestClient.ValidateAsync(scope, linkerName, cancellationToken).ConfigureAwait(false); + var operation = new ServiceLinkerArmOperation(new LinkerValidateOperationResultOperationSource(), LinkerClientDiagnostics, Pipeline, LinkerRestClient.CreateValidateRequest(scope, linkerName).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } } /// - /// Returns Linker resource for a given name. + /// Validate a link. /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker /// /// /// Operation Id - /// Linker_Get + /// Linker_Validate /// /// /// Default Api Version /// 2022-05-01 /// + /// + /// + /// The scope that the resource will apply against. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name Linker resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation ValidateLinker(ResourceIdentifier scope, WaitUntil waitUntil, string linkerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); + + using var scope0 = LinkerClientDiagnostics.CreateScope("MockableServiceLinkerArmClient.ValidateLinker"); + scope0.Start(); + try + { + var response = LinkerRestClient.Validate(scope, linkerName, cancellationToken); + var operation = new ServiceLinkerArmOperation(new LinkerValidateOperationResultOperationSource(), LinkerClientDiagnostics, Pipeline, LinkerRestClient.CreateValidateRequest(scope, linkerName).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } + } + + /// + /// list source configurations for a linker. + /// /// - /// Resource - /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations + /// + /// + /// Operation Id + /// Linker_ListConfigurations + /// + /// + /// Default Api Version + /// 2022-05-01 /// /// /// /// The scope that the resource will apply against. /// The name Linker resource. /// The cancellation token to use. - /// is null. /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetLinkerResource(ResourceIdentifier scope, string linkerName, CancellationToken cancellationToken = default) + /// or is null. + public virtual async Task> GetConfigurationsLinkerAsync(ResourceIdentifier scope, string linkerName, CancellationToken cancellationToken = default) { - return GetLinkerResources(scope).Get(linkerName, cancellationToken); + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); + + using var scope0 = LinkerClientDiagnostics.CreateScope("MockableServiceLinkerArmClient.GetConfigurationsLinker"); + scope0.Start(); + try + { + var response = await LinkerRestClient.ListConfigurationsAsync(scope, linkerName, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } } /// - /// 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. + /// list source configurations for a linker. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations + /// + /// + /// Operation Id + /// Linker_ListConfigurations + /// + /// + /// Default Api Version + /// 2022-05-01 + /// + /// /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual LinkerResource GetLinkerResource(ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The name Linker resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual Response GetConfigurationsLinker(ResourceIdentifier scope, string linkerName, CancellationToken cancellationToken = default) { - LinkerResource.ValidateResourceId(id); - return new LinkerResource(Client, id); + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); + + using var scope0 = LinkerClientDiagnostics.CreateScope("MockableServiceLinkerArmClient.GetConfigurationsLinker"); + scope0.Start(); + try + { + var response = LinkerRestClient.ListConfigurations(scope, linkerName, cancellationToken); + return response; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerArmResource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerArmResource.cs deleted file mode 100644 index 3ab29c77b49b..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/MockableServiceLinkerArmResource.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.ServiceLinker.Mocking -{ - /// A class to add extension methods to ArmResource. - public partial class MockableServiceLinkerArmResource : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected MockableServiceLinkerArmResource() - { - } - - /// 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 MockableServiceLinkerArmResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of LinkerResources in the ArmResource. - /// An object representing collection of LinkerResources and their operations over a LinkerResource. - public virtual LinkerResourceCollection GetLinkerResources() - { - return GetCachedClient(client => new LinkerResourceCollection(client, Id)); - } - - /// - /// Returns Linker resource for a given name. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name Linker resource. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetLinkerResourceAsync(string linkerName, CancellationToken cancellationToken = default) - { - return await GetLinkerResources().GetAsync(linkerName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Returns Linker resource for a given name. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name Linker resource. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetLinkerResource(string linkerName, CancellationToken cancellationToken = default) - { - return GetLinkerResources().Get(linkerName, 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..7853a3a40f8a 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerExtensions.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerExtensions.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.ResourceManager.ServiceLinker.Mocking; +using Azure.ResourceManager.ServiceLinker.Models; namespace Azure.ResourceManager.ServiceLinker { @@ -21,217 +22,206 @@ private static MockableServiceLinkerArmClient GetMockableServiceLinkerArmClient( return client.GetCachedClient(client0 => new MockableServiceLinkerArmClient(client0)); } - private static MockableServiceLinkerArmResource GetMockableServiceLinkerArmResource(ArmResource resource) - { - return resource.GetCachedClient(client => new MockableServiceLinkerArmResource(client, resource.Id)); - } - /// - /// Gets a collection of LinkerResources in the ArmClient. + /// Returns list of Linkers which connects to the resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers + /// + /// + /// Operation Id + /// Linker_List + /// + /// + /// Default Api Version + /// 2022-05-01 + /// + /// /// /// Mocking - /// To mock this method, please mock instead. + /// 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. - /// An object representing collection of LinkerResources and their operations over a LinkerResource. - public static LinkerResourceCollection GetLinkerResources(this ArmClient client, ResourceIdentifier scope) + public static AsyncPageable GetLinkersAsync(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableServiceLinkerArmClient(client).GetLinkerResources(scope); + return GetMockableServiceLinkerArmClient(client).GetLinkersAsync(scope, cancellationToken); } /// - /// Returns Linker resource for a given name. + /// Returns list of Linkers which connects to the resource. /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers /// /// /// Operation Id - /// Linker_Get + /// Linker_List /// /// /// Default Api Version /// 2022-05-01 /// - /// - /// Resource - /// - /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. - /// The name Linker resource. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static async Task> GetLinkerResourceAsync(this ArmClient client, ResourceIdentifier scope, string linkerName, CancellationToken cancellationToken = default) + /// is null. + public static Pageable GetLinkers(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return await GetMockableServiceLinkerArmClient(client).GetLinkerResourceAsync(scope, linkerName, cancellationToken).ConfigureAwait(false); + return GetMockableServiceLinkerArmClient(client).GetLinkers(scope, cancellationToken); } /// - /// Returns Linker resource for a given name. + /// Validate a link. /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker /// /// /// Operation Id - /// Linker_Get + /// Linker_Validate /// /// /// Default Api Version /// 2022-05-01 /// - /// - /// Resource - /// - /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The name Linker resource. /// The cancellation token to use. - /// or is null. /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static Response GetLinkerResource(this ArmClient client, ResourceIdentifier scope, string linkerName, CancellationToken cancellationToken = default) + /// or is null. + public static async Task> ValidateLinkerAsync(this ArmClient client, ResourceIdentifier scope, WaitUntil waitUntil, string linkerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableServiceLinkerArmClient(client).GetLinkerResource(scope, linkerName, cancellationToken); + return await GetMockableServiceLinkerArmClient(client).ValidateLinkerAsync(scope, waitUntil, linkerName, cancellationToken).ConfigureAwait(false); } /// - /// 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. + /// Validate a link. + /// /// - /// Mocking - /// To mock this method, please mock instead. + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker + /// + /// + /// Operation Id + /// Linker_Validate /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static LinkerResource GetLinkerResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableServiceLinkerArmClient(client).GetLinkerResource(id); - } - - /// - /// Gets a collection of LinkerResources in the ArmResource. + /// + /// Default Api Version + /// 2022-05-01 + /// + /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. - /// is null. - /// An object representing collection of LinkerResources and their operations over a LinkerResource. - public static LinkerResourceCollection GetLinkerResources(this ArmResource armResource) + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name Linker resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static ArmOperation ValidateLinker(this ArmClient client, ResourceIdentifier scope, WaitUntil waitUntil, string linkerName, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(armResource, nameof(armResource)); + Argument.AssertNotNull(client, nameof(client)); - return GetMockableServiceLinkerArmResource(armResource).GetLinkerResources(); + return GetMockableServiceLinkerArmClient(client).ValidateLinker(scope, waitUntil, linkerName, cancellationToken); } /// - /// Returns Linker resource for a given name. + /// list source configurations for a linker. /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations /// /// /// Operation Id - /// Linker_Get + /// Linker_ListConfigurations /// /// /// Default Api Version /// 2022-05-01 /// - /// - /// Resource - /// - /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The instance the method will execute against. + /// The scope that the resource will apply against. /// The name Linker resource. /// The cancellation token to use. - /// or is null. /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static async Task> GetLinkerResourceAsync(this ArmResource armResource, string linkerName, CancellationToken cancellationToken = default) + /// or is null. + public static async Task> GetConfigurationsLinkerAsync(this ArmClient client, ResourceIdentifier scope, string linkerName, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(armResource, nameof(armResource)); + Argument.AssertNotNull(client, nameof(client)); - return await GetMockableServiceLinkerArmResource(armResource).GetLinkerResourceAsync(linkerName, cancellationToken).ConfigureAwait(false); + return await GetMockableServiceLinkerArmClient(client).GetConfigurationsLinkerAsync(scope, linkerName, cancellationToken).ConfigureAwait(false); } /// - /// Returns Linker resource for a given name. + /// list source configurations for a linker. /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations /// /// /// Operation Id - /// Linker_Get + /// Linker_ListConfigurations /// /// /// Default Api Version /// 2022-05-01 /// - /// - /// Resource - /// - /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The instance the method will execute against. + /// The scope that the resource will apply against. /// The name Linker resource. /// The cancellation token to use. - /// or is null. /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static Response GetLinkerResource(this ArmResource armResource, string linkerName, CancellationToken cancellationToken = default) + /// or is null. + public static Response GetConfigurationsLinker(this ArmClient client, ResourceIdentifier scope, string linkerName, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(armResource, nameof(armResource)); + Argument.AssertNotNull(client, nameof(client)); - return GetMockableServiceLinkerArmResource(armResource).GetLinkerResource(linkerName, cancellationToken); + return GetMockableServiceLinkerArmClient(client).GetConfigurationsLinker(scope, linkerName, cancellationToken); } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Internal/Utf8JsonRequestContent.cs deleted file mode 100644 index fd9c9aa10b45..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Internal/Utf8JsonRequestContent.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.IO; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.ServiceLinker -{ - internal class Utf8JsonRequestContent : RequestContent - { - private readonly MemoryStream _stream; - private readonly RequestContent _content; - - public Utf8JsonRequestContent() - { - _stream = new MemoryStream(); - _content = Create(_stream); - JsonWriter = new Utf8JsonWriter(_stream); - } - - public Utf8JsonWriter JsonWriter { get; } - - public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) - { - await JsonWriter.FlushAsync().ConfigureAwait(false); - await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); - } - - public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) - { - JsonWriter.Flush(); - _content.WriteTo(stream, cancellationToken); - } - - public override bool TryComputeLength(out long length) - { - length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; - return true; - } - - public override void Dispose() - { - JsonWriter.Dispose(); - _content.Dispose(); - _stream.Dispose(); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.Serialization.cs deleted file mode 100644 index 24a8f1e2200d..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// 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 LinkerResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - LinkerResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - LinkerResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.cs deleted file mode 100644 index 0bdcec9574c4..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResource.cs +++ /dev/null @@ -1,506 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.ServiceLinker.Models; - -namespace Azure.ResourceManager.ServiceLinker -{ - /// - /// A Class representing a LinkerResource along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetLinkerResource method. - /// Otherwise you can get one from its parent resource using the GetLinkerResource method. - /// - public partial class LinkerResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The resourceUri. - /// The linkerName. - public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, string linkerName) - { - var resourceId = $"{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _linkerResourceLinkerClientDiagnostics; - private readonly LinkerRestOperations _linkerResourceLinkerRestClient; - private readonly LinkerResourceData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ServiceLinker/linkers"; - - /// Initializes a new instance of the class for mocking. - protected LinkerResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal LinkerResource(ArmClient client, LinkerResourceData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal LinkerResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _linkerResourceLinkerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceLinker", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string linkerResourceLinkerApiVersion); - _linkerResourceLinkerRestClient = new LinkerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, linkerResourceLinkerApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual LinkerResourceData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Returns Linker resource for a given name. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.Get"); - scope.Start(); - try - { - var response = await _linkerResourceLinkerRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new LinkerResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Returns Linker resource for a given name. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.Get"); - scope.Start(); - try - { - var response = _linkerResourceLinkerRestClient.Get(Id.Parent, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new LinkerResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a link. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Delete - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// 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 = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.Delete"); - scope.Start(); - try - { - var response = await _linkerResourceLinkerRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ServiceLinkerArmOperation(_linkerResourceLinkerClientDiagnostics, Pipeline, _linkerResourceLinkerRestClient.CreateDeleteRequest(Id.Parent, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a link. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Delete - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// 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 = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.Delete"); - scope.Start(); - try - { - var response = _linkerResourceLinkerRestClient.Delete(Id.Parent, Id.Name, cancellationToken); - var operation = new ServiceLinkerArmOperation(_linkerResourceLinkerClientDiagnostics, Pipeline, _linkerResourceLinkerRestClient.CreateDeleteRequest(Id.Parent, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Operation to update an existing link. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Update - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// 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. - /// Linker details. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, LinkerResourcePatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.Update"); - scope.Start(); - try - { - var response = await _linkerResourceLinkerRestClient.UpdateAsync(Id.Parent, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ServiceLinkerArmOperation(new LinkerResourceOperationSource(Client), _linkerResourceLinkerClientDiagnostics, Pipeline, _linkerResourceLinkerRestClient.CreateUpdateRequest(Id.Parent, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Operation to update an existing link. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Update - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// 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. - /// Linker details. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, LinkerResourcePatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.Update"); - scope.Start(); - try - { - var response = _linkerResourceLinkerRestClient.Update(Id.Parent, Id.Name, patch, cancellationToken); - var operation = new ServiceLinkerArmOperation(new LinkerResourceOperationSource(Client), _linkerResourceLinkerClientDiagnostics, Pipeline, _linkerResourceLinkerRestClient.CreateUpdateRequest(Id.Parent, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Validate a link. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker - /// - /// - /// Operation Id - /// Linker_Validate - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// 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.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Validate a link. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker - /// - /// - /// Operation Id - /// Linker_Validate - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// 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.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// list source configurations for a linker. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations - /// - /// - /// Operation Id - /// Linker_ListConfigurations - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetConfigurationsAsync(CancellationToken cancellationToken = default) - { - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.GetConfigurations"); - scope.Start(); - try - { - var response = await _linkerResourceLinkerRestClient.ListConfigurationsAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// list source configurations for a linker. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations - /// - /// - /// Operation Id - /// Linker_ListConfigurations - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response GetConfigurations(CancellationToken cancellationToken = default) - { - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResource.GetConfigurations"); - scope.Start(); - try - { - var response = _linkerResourceLinkerRestClient.ListConfigurations(Id.Parent, Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceCollection.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceCollection.cs deleted file mode 100644 index 23ce6c384ebd..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceCollection.cs +++ /dev/null @@ -1,483 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using 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 GetLinkerResources method from an instance of . - /// - public partial class LinkerResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _linkerResourceLinkerClientDiagnostics; - private readonly LinkerRestOperations _linkerResourceLinkerRestClient; - - /// Initializes a new instance of the class for mocking. - protected LinkerResourceCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal LinkerResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _linkerResourceLinkerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceLinker", LinkerResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(LinkerResource.ResourceType, out string linkerResourceLinkerApiVersion); - _linkerResourceLinkerRestClient = new LinkerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, linkerResourceLinkerApiVersion); - } - - /// - /// Create or update linker resource. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// 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 Linker resource. - /// Linker details. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string linkerName, LinkerResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResourceCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _linkerResourceLinkerRestClient.CreateOrUpdateAsync(Id, linkerName, data, cancellationToken).ConfigureAwait(false); - var operation = new ServiceLinkerArmOperation(new LinkerResourceOperationSource(Client), _linkerResourceLinkerClientDiagnostics, Pipeline, _linkerResourceLinkerRestClient.CreateCreateOrUpdateRequest(Id, linkerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update linker resource. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// 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 Linker resource. - /// Linker details. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string linkerName, LinkerResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResourceCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _linkerResourceLinkerRestClient.CreateOrUpdate(Id, linkerName, data, cancellationToken); - var operation = new ServiceLinkerArmOperation(new LinkerResourceOperationSource(Client), _linkerResourceLinkerClientDiagnostics, Pipeline, _linkerResourceLinkerRestClient.CreateCreateOrUpdateRequest(Id, linkerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Returns Linker resource for a given name. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name Linker resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResourceCollection.Get"); - scope.Start(); - try - { - var response = await _linkerResourceLinkerRestClient.GetAsync(Id, linkerName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new LinkerResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Returns Linker resource for a given name. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name Linker resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResourceCollection.Get"); - scope.Start(); - try - { - var response = _linkerResourceLinkerRestClient.Get(Id, linkerName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new LinkerResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Returns list of Linkers which connects to the resource. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers - /// - /// - /// Operation Id - /// Linker_List - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// 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) => _linkerResourceLinkerRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _linkerResourceLinkerRestClient.CreateListNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LinkerResource(Client, LinkerResourceData.DeserializeLinkerResourceData(e)), _linkerResourceLinkerClientDiagnostics, Pipeline, "LinkerResourceCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Returns list of Linkers which connects to the resource. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers - /// - /// - /// Operation Id - /// Linker_List - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// 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) => _linkerResourceLinkerRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _linkerResourceLinkerRestClient.CreateListNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LinkerResource(Client, LinkerResourceData.DeserializeLinkerResourceData(e)), _linkerResourceLinkerClientDiagnostics, Pipeline, "LinkerResourceCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name Linker resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResourceCollection.Exists"); - scope.Start(); - try - { - var response = await _linkerResourceLinkerRestClient.GetAsync(Id, linkerName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name Linker resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResourceCollection.Exists"); - scope.Start(); - try - { - var response = _linkerResourceLinkerRestClient.Get(Id, linkerName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name Linker resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResourceCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _linkerResourceLinkerRestClient.GetAsync(Id, linkerName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new LinkerResource(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/linkers/{linkerName} - /// - /// - /// Operation Id - /// Linker_Get - /// - /// - /// Default Api Version - /// 2022-05-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name Linker resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var scope = _linkerResourceLinkerClientDiagnostics.CreateScope("LinkerResourceCollection.GetIfExists"); - scope.Start(); - try - { - var response = _linkerResourceLinkerRestClient.Get(Id, linkerName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new LinkerResource(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/LinkerResourceData.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceData.cs deleted file mode 100644 index 8db41809168e..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceData.cs +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.ServiceLinker.Models; - -namespace Azure.ResourceManager.ServiceLinker -{ - /// - /// A class representing the LinkerResource data model. - /// Linker of source and target resource - /// - public partial class LinkerResourceData : 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 LinkerResourceData() - { - } - - /// 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. - /// 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) - { - TargetService = targetService; - AuthInfo = authInfo; - ClientType = clientType; - ProvisioningState = provisioningState; - VnetSolution = vnetSolution; - SecretStore = secretStore; - Scope = scope; - _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 . - /// - public TargetServiceBaseInfo TargetService { get; set; } - /// - /// The authentication type. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - public AuthBaseInfo AuthInfo { get; set; } - /// The application client type. - public LinkerClientType? ClientType { get; set; } - /// The provisioning state. - public string ProvisioningState { get; } - /// The VNet solution. - internal VnetSolution VnetSolution { get; set; } - /// Type of VNet solution. - public VnetSolutionType? SolutionType - { - get => VnetSolution is null ? default : VnetSolution.SolutionType; - set - { - if (VnetSolution is null) - VnetSolution = new VnetSolution(); - VnetSolution.SolutionType = value; - } - } - - /// An option to store secret value in secure place. - internal LinkerSecretStore SecretStore { get; set; } - /// The key vault id to store secret. - public ResourceIdentifier SecretStoreKeyVaultId - { - get => SecretStore is null ? default : SecretStore.KeyVaultId; - set - { - if (SecretStore is null) - SecretStore = new LinkerSecretStore(); - SecretStore.KeyVaultId = value; - } - } - - /// connection scope in source service. - public string Scope { get; set; } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/LinkerResourceOperationSource.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/LinkerResourceOperationSource.cs deleted file mode 100644 index 5bba65234499..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/LinkerResourceOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.ServiceLinker -{ - internal class LinkerResourceOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal LinkerResourceOperationSource(ArmClient client) - { - _client = client; - } - - LinkerResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = LinkerResourceData.DeserializeLinkerResourceData(document.RootElement); - return new LinkerResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = LinkerResourceData.DeserializeLinkerResourceData(document.RootElement); - return new LinkerResource(_client, data); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerArmOperation.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerArmOperation.cs deleted file mode 100644 index 41ee6a2e4a0d..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LongRunningOperation/ServiceLinkerArmOperation.cs +++ /dev/null @@ -1,94 +0,0 @@ -// 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.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.ServiceLinker -{ -#pragma warning disable SA1649 // File name should match first type name - internal class ServiceLinkerArmOperation : ArmOperation -#pragma warning restore SA1649 // File name should match first type name - { - private readonly OperationInternal _operation; - private readonly RehydrationToken? _completeRehydrationToken; - private readonly NextLinkOperationImplementation _nextLinkOperation; - private readonly string _operationId; - - /// Initializes a new instance of ServiceLinkerArmOperation for mocking. - protected ServiceLinkerArmOperation() - { - } - - internal ServiceLinkerArmOperation(Response response, RehydrationToken? rehydrationToken = null) - { - _operation = OperationInternal.Succeeded(response); - _completeRehydrationToken = rehydrationToken; - _operationId = GetOperationId(rehydrationToken); - } - - internal ServiceLinkerArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) - { - var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); - if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) - { - _nextLinkOperation = nextLinkOperationValue; - _operationId = _nextLinkOperation.OperationId; - } - else - { - _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); - _operationId = GetOperationId(_completeRehydrationToken); - } - _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "ServiceLinkerArmOperation", fallbackStrategy: new SequentialDelayStrategy()); - } - - private string GetOperationId(RehydrationToken? rehydrationToken) - { - if (rehydrationToken is null) - { - return null; - } - var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); - return lroDetails["id"]; - } - /// - public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; - - /// - public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; - - /// - public override bool HasCompleted => _operation.HasCompleted; - - /// - public override Response GetRawResponse() => _operation.RawResponse; - - /// - public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); - - /// - public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); - - /// - public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); - - /// - public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); - - /// - public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); - - /// - public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureKeyVaultProperties.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureKeyVaultProperties.cs index bc73c87ff139..0168a868b66c 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureKeyVaultProperties.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureKeyVaultProperties.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models public partial class AzureKeyVaultProperties : AzureResourceBaseProperties { /// Initializes a new instance of . - public AzureKeyVaultProperties() + internal AzureKeyVaultProperties() { AzureResourceType = AzureResourceType.KeyVault; } @@ -30,6 +30,6 @@ internal AzureKeyVaultProperties(AzureResourceType azureResourceType, IDictionar } /// True if connect via Kubernetes CSI Driver. - public bool? DoesConnectAsKubernetesCsiDriver { get; set; } + public bool? DoesConnectAsKubernetesCsiDriver { get; } } } 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..a65e497000b0 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/AzureResourceInfo.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models public partial class AzureResourceInfo : TargetServiceBaseInfo { /// Initializes a new instance of . - public AzureResourceInfo() + internal AzureResourceInfo() { TargetServiceType = TargetServiceType.AzureResource; } @@ -37,12 +37,12 @@ internal AzureResourceInfo(TargetServiceType targetServiceType, IDictionary The Id of azure resource. - public ResourceIdentifier Id { get; set; } + public ResourceIdentifier Id { get; } /// /// The azure resource connection related properties. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// - public AzureResourceBaseProperties ResourceProperties { get; set; } + public AzureResourceBaseProperties ResourceProperties { get; } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentBootstrapServerInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentBootstrapServerInfo.cs index c89e1efc800c..fa51a198dcf2 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentBootstrapServerInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentBootstrapServerInfo.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models public partial class ConfluentBootstrapServerInfo : TargetServiceBaseInfo { /// Initializes a new instance of . - public ConfluentBootstrapServerInfo() + internal ConfluentBootstrapServerInfo() { TargetServiceType = TargetServiceType.ConfluentBootstrapServer; } @@ -30,6 +30,6 @@ internal ConfluentBootstrapServerInfo(TargetServiceType targetServiceType, IDict } /// The endpoint of service. - public string Endpoint { get; set; } + public string Endpoint { get; } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentSchemaRegistryInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentSchemaRegistryInfo.cs index 432aecab32d3..6bbeaffe01c7 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentSchemaRegistryInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ConfluentSchemaRegistryInfo.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models public partial class ConfluentSchemaRegistryInfo : TargetServiceBaseInfo { /// Initializes a new instance of . - public ConfluentSchemaRegistryInfo() + internal ConfluentSchemaRegistryInfo() { TargetServiceType = TargetServiceType.ConfluentSchemaRegistry; } @@ -30,6 +30,6 @@ internal ConfluentSchemaRegistryInfo(TargetServiceType targetServiceType, IDicti } /// The endpoint of service. - public string Endpoint { get; set; } + public string Endpoint { get; } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretReferenceSecretInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretReferenceSecretInfo.cs index 793c99e0e69d..8b0197d3f4d5 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretReferenceSecretInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretReferenceSecretInfo.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models public partial class KeyVaultSecretReferenceSecretInfo : SecretBaseInfo { /// Initializes a new instance of . - public KeyVaultSecretReferenceSecretInfo() + internal KeyVaultSecretReferenceSecretInfo() { SecretType = LinkerSecretType.KeyVaultSecretReference; } @@ -32,8 +32,8 @@ internal KeyVaultSecretReferenceSecretInfo(LinkerSecretType secretType, IDiction } /// Name of the Key Vault secret. - public string Name { get; set; } + public string Name { get; } /// Version of the Key Vault secret. - public string Version { get; set; } + public string Version { get; } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretUriSecretInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretUriSecretInfo.cs index e5dbbdaea30c..7e7809615078 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretUriSecretInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/KeyVaultSecretUriSecretInfo.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models public partial class KeyVaultSecretUriSecretInfo : SecretBaseInfo { /// Initializes a new instance of . - public KeyVaultSecretUriSecretInfo() + internal KeyVaultSecretUriSecretInfo() { SecretType = LinkerSecretType.KeyVaultSecretUri; } @@ -30,6 +30,6 @@ internal KeyVaultSecretUriSecretInfo(LinkerSecretType secretType, IDictionary URI to the keyvault secret. - public string Value { get; set; } + public string Value { get; } } } 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 ddc43894541f..0eb06984d2c9 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerClientType.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerClientType.cs @@ -32,6 +32,7 @@ public LinkerClientType(string value) private const string DjangoValue = "django"; private const string NodejsValue = "nodejs"; private const string SpringBootValue = "springBoot"; + private const string KafkaSpringBootValue = "kafka-springBoot"; /// none. public static LinkerClientType None { get; } = new LinkerClientType(NoneValue); @@ -53,6 +54,8 @@ public LinkerClientType(string value) public static LinkerClientType Nodejs { get; } = new LinkerClientType(NodejsValue); /// springBoot. public static LinkerClientType SpringBoot { get; } = new LinkerClientType(SpringBootValue); + /// kafka-springBoot. + public static LinkerClientType KafkaSpringBoot { get; } = new LinkerClientType(KafkaSpringBootValue); /// Determines if two values are the same. public static bool operator ==(LinkerClientType left, LinkerClientType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.Serialization.cs index 0f26ccc71a04..3c626c5d7fb9 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.Serialization.cs @@ -87,7 +87,7 @@ internal static LinkerList DeserializeLinkerList(JsonElement element, ModelReade return null; } string nextLink = default; - IReadOnlyList value = default; + IReadOnlyList value = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -108,10 +108,10 @@ internal static LinkerList DeserializeLinkerList(JsonElement element, ModelReade { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(LinkerResourceData.DeserializeLinkerResourceData(item, options)); + array.Add(LinkerResource.DeserializeLinkerResource(item, options)); } value = array; continue; @@ -122,7 +122,7 @@ internal static LinkerList DeserializeLinkerList(JsonElement element, ModelReade } } serializedAdditionalRawData = rawDataDictionary; - return new LinkerList(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new LinkerList(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.cs index 03dbf27871a4..5693daf01452 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerList.cs @@ -48,14 +48,14 @@ internal partial class LinkerList /// Initializes a new instance of . internal LinkerList() { - Value = new ChangeTrackingList(); + Value = new ChangeTrackingList(); } /// Initializes a new instance of . /// The link used to get the next page of Linker list. /// The list of Linkers. /// Keeps track of any properties unknown to the library. - internal LinkerList(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal LinkerList(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) { NextLink = nextLink; Value = value; @@ -65,6 +65,6 @@ internal LinkerList(string nextLink, IReadOnlyList value, ID /// The link used to get the next page of Linker list. public string NextLink { get; } /// The list of Linkers. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceData.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResource.Serialization.cs similarity index 85% rename from sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceData.Serialization.cs rename to sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResource.Serialization.cs index 8c18577daae6..8704c3ff5a93 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/LinkerResourceData.Serialization.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResource.Serialization.cs @@ -11,20 +11,19 @@ using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Models; -using Azure.ResourceManager.ServiceLinker.Models; -namespace Azure.ResourceManager.ServiceLinker +namespace Azure.ResourceManager.ServiceLinker.Models { - public partial class LinkerResourceData : IUtf8JsonSerializable, IJsonModel + public partial class LinkerResource : 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) { - 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(LinkerResourceData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(LinkerResource)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -125,19 +124,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteEndObject(); } - LinkerResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + LinkerResource 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(LinkerResourceData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(LinkerResource)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLinkerResourceData(document.RootElement, options); + return DeserializeLinkerResource(document.RootElement, options); } - internal static LinkerResourceData DeserializeLinkerResourceData(JsonElement element, ModelReaderWriterOptions options = null) + internal static LinkerResource DeserializeLinkerResource(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -264,7 +263,7 @@ internal static LinkerResourceData DeserializeLinkerResourceData(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new LinkerResourceData( + return new LinkerResource( id, name, type, @@ -279,35 +278,35 @@ internal static LinkerResourceData DeserializeLinkerResourceData(JsonElement ele 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); default: - throw new FormatException($"The model {nameof(LinkerResourceData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(LinkerResource)} does not support writing '{options.Format}' format."); } } - LinkerResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + LinkerResource 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); - return DeserializeLinkerResourceData(document.RootElement, options); + return DeserializeLinkerResource(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LinkerResourceData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(LinkerResource)} 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/LinkerResourcePatch.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResource.cs similarity index 80% rename from sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.cs rename to sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResource.cs index 34b1d74da55b..94ab569564ba 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResource.cs @@ -8,11 +8,12 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.ServiceLinker.Models { - /// A linker to be updated. - public partial class LinkerResourcePatch + /// Linker of source and target resource. + public partial class LinkerResource : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -46,12 +47,16 @@ public partial class LinkerResourcePatch /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public LinkerResourcePatch() + /// Initializes a new instance of . + internal LinkerResource() { } - /// Initializes a new instance of . + /// 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. @@ -68,7 +73,7 @@ public LinkerResourcePatch() /// An option to store secret value in secure place. /// connection scope in source service. /// 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 LinkerResource(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) { TargetService = targetService; AuthInfo = authInfo; @@ -85,46 +90,34 @@ internal LinkerResourcePatch(TargetServiceBaseInfo targetService, AuthBaseInfo a /// 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; } + public TargetServiceBaseInfo TargetService { get; } /// /// 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; } + public AuthBaseInfo AuthInfo { get; } /// The application client type. - public LinkerClientType? ClientType { get; set; } + public LinkerClientType? ClientType { get; } /// The provisioning state. public string ProvisioningState { get; } /// The VNet solution. - internal VnetSolution VnetSolution { get; set; } + internal VnetSolution VnetSolution { get; } /// 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; - } + get => VnetSolution?.SolutionType; } /// An option to store secret value in secure place. - internal LinkerSecretStore SecretStore { get; set; } + internal LinkerSecretStore SecretStore { get; } /// 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; - } + get => SecretStore?.KeyVaultId; } /// connection scope in source service. - public string Scope { get; set; } + public string Scope { get; } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.Serialization.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.Serialization.cs deleted file mode 100644 index a3754e7ec1cd..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerResourcePatch.Serialization.cs +++ /dev/null @@ -1,259 +0,0 @@ -// 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 LinkerResourcePatch : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(LinkerResourcePatch)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - 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"); - } - } - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - LinkerResourcePatch 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(LinkerResourcePatch)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLinkerResourcePatch(document.RootElement, options); - } - - internal static LinkerResourcePatch DeserializeLinkerResourcePatch(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; - 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) - { - continue; - } - targetService = TargetServiceBaseInfo.DeserializeTargetServiceBaseInfo(property0.Value, options); - continue; - } - if (property0.NameEquals("authInfo"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - authInfo = AuthBaseInfo.DeserializeAuthBaseInfo(property0.Value, options); - continue; - } - if (property0.NameEquals("clientType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - clientType = new LinkerClientType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - provisioningState = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("vNetSolution"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - vnetSolution = null; - continue; - } - vnetSolution = VnetSolution.DeserializeVnetSolution(property0.Value, options); - continue; - } - if (property0.NameEquals("secretStore"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - secretStore = null; - continue; - } - secretStore = LinkerSecretStore.DeserializeLinkerSecretStore(property0.Value, options); - continue; - } - if (property0.NameEquals("scope"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - scope = null; - continue; - } - scope = property0.Value.GetString(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new LinkerResourcePatch( - targetService, - authInfo, - clientType, - provisioningState, - vnetSolution, - secretStore, - 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); - default: - throw new FormatException($"The model {nameof(LinkerResourcePatch)} does not support writing '{options.Format}' format."); - } - } - - LinkerResourcePatch 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); - return DeserializeLinkerResourcePatch(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(LinkerResourcePatch)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} 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..9685ab1b591a 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretStore.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/LinkerSecretStore.cs @@ -47,7 +47,7 @@ internal partial class LinkerSecretStore private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public LinkerSecretStore() + internal LinkerSecretStore() { } @@ -61,6 +61,6 @@ internal LinkerSecretStore(ResourceIdentifier keyVaultId, IDictionary The key vault id to store secret. - public ResourceIdentifier KeyVaultId { get; set; } + public ResourceIdentifier KeyVaultId { get; } } } diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/RawValueSecretInfo.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/RawValueSecretInfo.cs index f0ee38f8f62f..98bc4783b067 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/RawValueSecretInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/RawValueSecretInfo.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models public partial class RawValueSecretInfo : SecretBaseInfo { /// Initializes a new instance of . - public RawValueSecretInfo() + internal RawValueSecretInfo() { SecretType = LinkerSecretType.RawValue; } @@ -30,6 +30,6 @@ internal RawValueSecretInfo(LinkerSecretType secretType, IDictionary The actual value of the secret. - public string Value { get; set; } + public string Value { get; } } } 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..dc9fac2eadf1 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretAuthInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SecretAuthInfo.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models public partial class SecretAuthInfo : AuthBaseInfo { /// Initializes a new instance of . - public SecretAuthInfo() + internal SecretAuthInfo() { AuthType = LinkerAuthType.Secret; } @@ -36,12 +36,12 @@ internal SecretAuthInfo(LinkerAuthType authType, IDictionary } /// Username or account name for secret auth. - public string Name { get; set; } + public string Name { get; } /// /// Password or key vault secret for secret auth. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , and . /// - public SecretBaseInfo SecretInfo { get; set; } + public SecretBaseInfo SecretInfo { get; } } } 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..22b978976176 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalCertificateAuthInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalCertificateAuthInfo.cs @@ -18,7 +18,7 @@ public partial class ServicePrincipalCertificateAuthInfo : AuthBaseInfo /// Principal Id for servicePrincipal auth. /// ServicePrincipal certificate for servicePrincipal auth. /// or is null. - public ServicePrincipalCertificateAuthInfo(string clientId, Guid principalId, string certificate) + internal ServicePrincipalCertificateAuthInfo(string clientId, Guid principalId, string certificate) { Argument.AssertNotNull(clientId, nameof(clientId)); Argument.AssertNotNull(certificate, nameof(certificate)); @@ -49,10 +49,10 @@ internal ServicePrincipalCertificateAuthInfo() } /// Application clientId for servicePrincipal auth. - public string ClientId { get; set; } + public string ClientId { get; } /// Principal Id for servicePrincipal auth. - public Guid PrincipalId { get; set; } + public Guid PrincipalId { get; } /// ServicePrincipal certificate for servicePrincipal auth. - public string Certificate { get; set; } + public string Certificate { get; } } } 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..a503b286ff3a 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalSecretAuthInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/ServicePrincipalSecretAuthInfo.cs @@ -18,7 +18,7 @@ public partial class ServicePrincipalSecretAuthInfo : AuthBaseInfo /// Principal Id for servicePrincipal auth. /// Secret for servicePrincipal auth. /// or is null. - public ServicePrincipalSecretAuthInfo(string clientId, Guid principalId, string secret) + internal ServicePrincipalSecretAuthInfo(string clientId, Guid principalId, string secret) { Argument.AssertNotNull(clientId, nameof(clientId)); Argument.AssertNotNull(secret, nameof(secret)); @@ -49,10 +49,10 @@ internal ServicePrincipalSecretAuthInfo() } /// ServicePrincipal application clientId for servicePrincipal auth. - public string ClientId { get; set; } + public string ClientId { get; } /// Principal Id for servicePrincipal auth. - public Guid PrincipalId { get; set; } + public Guid PrincipalId { get; } /// Secret for servicePrincipal auth. - public string Secret { get; set; } + public string Secret { get; } } } 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..b3951fb57e25 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SystemAssignedIdentityAuthInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/SystemAssignedIdentityAuthInfo.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models public partial class SystemAssignedIdentityAuthInfo : AuthBaseInfo { /// Initializes a new instance of . - public SystemAssignedIdentityAuthInfo() + internal SystemAssignedIdentityAuthInfo() { AuthType = LinkerAuthType.SystemAssignedIdentity; } 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..137a7680ad69 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UserAssignedIdentityAuthInfo.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/UserAssignedIdentityAuthInfo.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.ServiceLinker.Models public partial class UserAssignedIdentityAuthInfo : AuthBaseInfo { /// Initializes a new instance of . - public UserAssignedIdentityAuthInfo() + internal UserAssignedIdentityAuthInfo() { AuthType = LinkerAuthType.UserAssignedIdentity; } @@ -32,8 +32,8 @@ internal UserAssignedIdentityAuthInfo(LinkerAuthType authType, IDictionary Client Id for userAssignedIdentity. - public string ClientId { get; set; } + public string ClientId { get; } /// Subscription id for userAssignedIdentity. - public string SubscriptionId { get; set; } + public string SubscriptionId { get; } } } 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..f818c7a6ccef 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolution.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Models/VnetSolution.cs @@ -46,7 +46,7 @@ internal partial class VnetSolution private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public VnetSolution() + internal VnetSolution() { } @@ -60,6 +60,6 @@ internal VnetSolution(VnetSolutionType? solutionType, IDictionary Type of VNet solution. - public VnetSolutionType? SolutionType { get; set; } + public VnetSolutionType? SolutionType { get; } } } 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 5493f67fe2bc..4fd1c9919953 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/LinkerRestOperations.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/RestOperations/LinkerRestOperations.cs @@ -112,340 +112,6 @@ public Response List(string resourceUri, CancellationToken cancellat } } - internal RequestUriBuilder CreateGetRequestUri(string resourceUri, string linkerName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.ServiceLinker/linkers/", false); - uri.AppendPath(linkerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string resourceUri, string linkerName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.ServiceLinker/linkers/", false); - uri.AppendPath(linkerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Returns Linker resource for a given name. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string resourceUri, string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var message = CreateGetRequest(resourceUri, linkerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - LinkerResourceData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = LinkerResourceData.DeserializeLinkerResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((LinkerResourceData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Returns Linker resource for a given name. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response Get(string resourceUri, string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var message = CreateGetRequest(resourceUri, linkerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - LinkerResourceData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = LinkerResourceData.DeserializeLinkerResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((LinkerResourceData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, string linkerName, LinkerResourceData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.ServiceLinker/linkers/", false); - uri.AppendPath(linkerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string linkerName, LinkerResourceData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.ServiceLinker/linkers/", false); - uri.AppendPath(linkerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Create or update linker resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// Linker details. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string resourceUri, string linkerName, LinkerResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(resourceUri, linkerName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update linker resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// Linker details. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string resourceUri, string linkerName, LinkerResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(resourceUri, linkerName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string resourceUri, string linkerName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.ServiceLinker/linkers/", false); - uri.AppendPath(linkerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string resourceUri, string linkerName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.ServiceLinker/linkers/", false); - uri.AppendPath(linkerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete a link. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string resourceUri, string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var message = CreateDeleteRequest(resourceUri, linkerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete a link. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response Delete(string resourceUri, string linkerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - - using var message = CreateDeleteRequest(resourceUri, linkerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateRequestUri(string resourceUri, string linkerName, LinkerResourcePatch patch) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.ServiceLinker/linkers/", false); - uri.AppendPath(linkerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string resourceUri, string linkerName, LinkerResourcePatch patch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.ServiceLinker/linkers/", false); - uri.AppendPath(linkerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Operation to update an existing link. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// Linker details. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string resourceUri, string linkerName, LinkerResourcePatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(resourceUri, linkerName, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Operation to update an existing link. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// Linker details. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public Response Update(string resourceUri, string linkerName, LinkerResourcePatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - Argument.AssertNotNullOrEmpty(linkerName, nameof(linkerName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(resourceUri, linkerName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateValidateRequestUri(string resourceUri, string linkerName) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/autorest.md b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/autorest.md index 4ebbecf6d1f1..855e68692e05 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: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/servicelinker/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: