diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/CHANGELOG.md b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/CHANGELOG.md index c3a38e4333b5c..a6f667bc940a5 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/CHANGELOG.md +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/CHANGELOG.md @@ -1,18 +1,13 @@ # Release History -## 1.0.0-beta.5 (Unreleased) +## 1.0.0-beta.5 (2024-11-18) ### Features Added +- Release SDK for MultiCloud - Enable the new model serialization by using the System.ClientModel, refer this [document](https://aka.ms/azsdk/net/mrw) for more details. - Exposed `JsonModelWriteCore` for model serialization procedure. -### Breaking Changes - -### Bugs Fixed - -### Other Changes - ## 1.0.0-beta.4 (2023-11-29) ### Features Added diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/README.md b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/README.md index 9a7b8f0a27db2..1ee8bd945a056 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/README.md +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/README.md @@ -10,7 +10,7 @@ This library follows the [new Azure SDK guidelines](https://azure.github.io/azur - Better error-handling. - Support uniform telemetry across all languages. -## Getting started +## Getting started ### Install the package @@ -77,4 +77,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/api/Azure.ResourceManager.HybridConnectivity.net8.0.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/api/Azure.ResourceManager.HybridConnectivity.net8.0.cs index 6cf1e17715b84..4f5455a011f0f 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/api/Azure.ResourceManager.HybridConnectivity.net8.0.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/api/Azure.ResourceManager.HybridConnectivity.net8.0.cs @@ -11,8 +11,15 @@ protected EndpointResource() { } 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 GetCredentials(long? expiresin = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetCredentialsAsync(long? expiresin = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCredentials(Azure.ResourceManager.HybridConnectivity.Models.ListCredentialsContent content = null, long? expiresin = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCredentialsAsync(Azure.ResourceManager.HybridConnectivity.Models.ListCredentialsContent content = null, long? expiresin = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetIngressGatewayCredentials(Azure.ResourceManager.HybridConnectivity.Models.ListIngressGatewayCredentialsContent content = null, long? expiresin = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIngressGatewayCredentialsAsync(Azure.ResourceManager.HybridConnectivity.Models.ListIngressGatewayCredentialsContent content = null, long? expiresin = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetManagedProxyDetails(Azure.ResourceManager.HybridConnectivity.Models.ManagedProxyContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetManagedProxyDetailsAsync(Azure.ResourceManager.HybridConnectivity.Models.ManagedProxyContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetServiceConfigurationResource(string serviceConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetServiceConfigurationResourceAsync(string serviceConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResourceCollection GetServiceConfigurationResources() { throw null; } Azure.ResourceManager.HybridConnectivity.EndpointResourceData 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.HybridConnectivity.EndpointResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -41,15 +48,7 @@ protected EndpointResourceCollection() { } public partial class EndpointResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public EndpointResourceData() { } - public string CreatedBy { get { throw null; } set { } } - public Azure.ResourceManager.HybridConnectivity.Models.CreatedByType? CreatedByType { get { throw null; } set { } } - public System.DateTimeOffset? CreatedOn { get { throw null; } set { } } - public Azure.ResourceManager.HybridConnectivity.Models.EndpointType? EndpointType { get { throw null; } set { } } - public string LastModifiedBy { get { throw null; } set { } } - public Azure.ResourceManager.HybridConnectivity.Models.CreatedByType? LastModifiedByType { get { throw null; } set { } } - public System.DateTimeOffset? LastModifiedOn { get { throw null; } set { } } - public string ProvisioningState { get { throw null; } } - public string ResourceId { get { throw null; } set { } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityEndpointProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HybridConnectivity.EndpointResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -63,6 +62,265 @@ public static partial class HybridConnectivityExtensions public static Azure.Response GetEndpointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetEndpointResourceAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.HybridConnectivity.EndpointResourceCollection GetEndpointResources(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.HybridConnectivityInventoryResource GetHybridConnectivityInventoryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetPublicCloudConnector(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string publicCloudConnector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetPublicCloudConnectorAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string publicCloudConnector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorResource GetPublicCloudConnectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorCollection GetPublicCloudConnectors(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetPublicCloudConnectors(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetPublicCloudConnectorsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResource GetServiceConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetSolutionConfiguration(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string solutionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetSolutionConfigurationAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string solutionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.SolutionConfigurationResource GetSolutionConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.SolutionConfigurationCollection GetSolutionConfigurations(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.SolutionTypeResource GetSolutionTypeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetSolutionTypeResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string solutionType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetSolutionTypeResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string solutionType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.SolutionTypeResourceCollection GetSolutionTypeResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetSolutionTypeResources(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetSolutionTypeResourcesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response PostGenerateAwsTemplate(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.HybridConnectivity.Models.GenerateAwsTemplateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> PostGenerateAwsTemplateAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.HybridConnectivity.Models.GenerateAwsTemplateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class HybridConnectivityInventoryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected HybridConnectivityInventoryResource() { } + public virtual Azure.ResourceManager.HybridConnectivity.HybridConnectivityInventoryResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string solutionConfiguration, string inventoryId) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.HybridConnectivity.HybridConnectivityInventoryResourceData 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.HybridConnectivity.HybridConnectivityInventoryResourceData 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 HybridConnectivityInventoryResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected HybridConnectivityInventoryResourceCollection() { } + public virtual Azure.Response Exists(string inventoryId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string inventoryId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string inventoryId, 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 inventoryId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string inventoryId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string inventoryId, 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 HybridConnectivityInventoryResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HybridConnectivityInventoryResourceData() { } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityInventoryProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.HybridConnectivityInventoryResourceData 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.HybridConnectivity.HybridConnectivityInventoryResourceData 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 PublicCloudConnectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected PublicCloudConnectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string publicCloudConnector, Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string publicCloudConnector, Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string publicCloudConnector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string publicCloudConnector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string publicCloudConnector, 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 publicCloudConnector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string publicCloudConnector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string publicCloudConnector, 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 PublicCloudConnectorData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PublicCloudConnectorData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.HybridConnectivity.Models.PublicCloudConnectorProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorData 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.HybridConnectivity.PublicCloudConnectorData 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 PublicCloudConnectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected PublicCloudConnectorResource() { } + public virtual Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string publicCloudConnector) { 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 RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorData 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.HybridConnectivity.PublicCloudConnectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation TestPermissions(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> TestPermissionsAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.HybridConnectivity.Models.PublicCloudConnectorPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.HybridConnectivity.Models.PublicCloudConnectorPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ServiceConfigurationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ServiceConfigurationResource() { } + public virtual Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string scope, string endpointName, string serviceConfigurationName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResourceData 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.HybridConnectivity.ServiceConfigurationResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.HybridConnectivity.Models.ServiceConfigurationResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.HybridConnectivity.Models.ServiceConfigurationResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ServiceConfigurationResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ServiceConfigurationResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string serviceConfigurationName, Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string serviceConfigurationName, Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string serviceConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string serviceConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string serviceConfigurationName, 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 serviceConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string serviceConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string serviceConfigurationName, 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 ServiceConfigurationResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServiceConfigurationResourceData() { } + public long? Port { get { throw null; } set { } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName? ServiceName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResourceData 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.HybridConnectivity.ServiceConfigurationResourceData 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 SolutionConfigurationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected SolutionConfigurationCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string solutionConfiguration, Azure.ResourceManager.HybridConnectivity.SolutionConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string solutionConfiguration, Azure.ResourceManager.HybridConnectivity.SolutionConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string solutionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string solutionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string solutionConfiguration, 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 solutionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string solutionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string solutionConfiguration, 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 SolutionConfigurationData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SolutionConfigurationData() { } + public Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.SolutionConfigurationData 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.HybridConnectivity.SolutionConfigurationData 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 SolutionConfigurationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected SolutionConfigurationResource() { } + public virtual Azure.ResourceManager.HybridConnectivity.SolutionConfigurationData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string solutionConfiguration) { 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 GetHybridConnectivityInventoryResource(string inventoryId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetHybridConnectivityInventoryResourceAsync(string inventoryId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.HybridConnectivityInventoryResourceCollection GetHybridConnectivityInventoryResources() { throw null; } + public virtual Azure.ResourceManager.ArmOperation SyncNow(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SyncNowAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.HybridConnectivity.SolutionConfigurationData 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.HybridConnectivity.SolutionConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class SolutionTypeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected SolutionTypeResource() { } + public virtual Azure.ResourceManager.HybridConnectivity.SolutionTypeResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string solutionType) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.HybridConnectivity.SolutionTypeResourceData 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.HybridConnectivity.SolutionTypeResourceData 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 SolutionTypeResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected SolutionTypeResourceCollection() { } + public virtual Azure.Response Exists(string solutionType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string solutionType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string solutionType, 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 solutionType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string solutionType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string solutionType, 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 SolutionTypeResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SolutionTypeResourceData() { } + public Azure.ResourceManager.HybridConnectivity.Models.SolutionTypeProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.SolutionTypeResourceData 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.HybridConnectivity.SolutionTypeResourceData 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; } } } namespace Azure.ResourceManager.HybridConnectivity.Mocking @@ -74,34 +332,72 @@ protected MockableHybridConnectivityArmClient() { } public virtual Azure.Response GetEndpointResource(Azure.Core.ResourceIdentifier scope, string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetEndpointResourceAsync(Azure.Core.ResourceIdentifier scope, string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HybridConnectivity.EndpointResourceCollection GetEndpointResources(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.HybridConnectivityInventoryResource GetHybridConnectivityInventoryResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorResource GetPublicCloudConnectorResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResource GetServiceConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.Response GetSolutionConfiguration(Azure.Core.ResourceIdentifier scope, string solutionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetSolutionConfigurationAsync(Azure.Core.ResourceIdentifier scope, string solutionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.SolutionConfigurationResource GetSolutionConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.SolutionConfigurationCollection GetSolutionConfigurations(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.SolutionTypeResource GetSolutionTypeResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableHybridConnectivityResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableHybridConnectivityResourceGroupResource() { } + public virtual Azure.Response GetPublicCloudConnector(string publicCloudConnector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPublicCloudConnectorAsync(string publicCloudConnector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorCollection GetPublicCloudConnectors() { throw null; } + public virtual Azure.Response GetSolutionTypeResource(string solutionType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetSolutionTypeResourceAsync(string solutionType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.SolutionTypeResourceCollection GetSolutionTypeResources() { throw null; } + } + public partial class MockableHybridConnectivitySubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableHybridConnectivitySubscriptionResource() { } + public virtual Azure.Pageable GetPublicCloudConnectors(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetPublicCloudConnectorsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetSolutionTypeResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetSolutionTypeResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response PostGenerateAwsTemplate(Azure.ResourceManager.HybridConnectivity.Models.GenerateAwsTemplateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PostGenerateAwsTemplateAsync(Azure.ResourceManager.HybridConnectivity.Models.GenerateAwsTemplateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.HybridConnectivity.Models { public static partial class ArmHybridConnectivityModelFactory { - public static Azure.ResourceManager.HybridConnectivity.EndpointResourceData EndpointResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridConnectivity.Models.EndpointType? endpointType = default(Azure.ResourceManager.HybridConnectivity.Models.EndpointType?), string resourceId = null, string provisioningState = null, string createdBy = null, Azure.ResourceManager.HybridConnectivity.Models.CreatedByType? createdByType = default(Azure.ResourceManager.HybridConnectivity.Models.CreatedByType?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string lastModifiedBy = null, Azure.ResourceManager.HybridConnectivity.Models.CreatedByType? lastModifiedByType = default(Azure.ResourceManager.HybridConnectivity.Models.CreatedByType?), System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?)) { throw null; } - public static Azure.ResourceManager.HybridConnectivity.Models.TargetResourceEndpointAccess TargetResourceEndpointAccess(string namespaceName = null, string namespaceNameSuffix = null, string hybridConnectionName = null, string accessKey = null, long? expiresOn = default(long?)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.EndpointResourceData EndpointResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityEndpointProperties properties = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.GenerateAwsTemplateContent GenerateAwsTemplateContent(Azure.Core.ResourceIdentifier connectorId = null, System.Collections.Generic.IEnumerable solutionTypes = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityEndpointProperties HybridConnectivityEndpointProperties(Azure.ResourceManager.HybridConnectivity.Models.EndpointType endpointType = default(Azure.ResourceManager.HybridConnectivity.Models.EndpointType), Azure.Core.ResourceIdentifier resourceId = null, string provisioningState = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityInventoryProperties HybridConnectivityInventoryProperties(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType? cloudNativeType = default(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType?), string cloudNativeResourceId = null, Azure.Core.ResourceIdentifier azureResourceId = null, Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus? status = default(Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus?), string statusDetails = null, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState? provisioningState = default(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState?)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.HybridConnectivityInventoryResourceData HybridConnectivityInventoryResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityInventoryProperties properties = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.IngressGatewayAsset IngressGatewayAsset(string hostname = null, Azure.Core.ResourceIdentifier serverId = null, System.Guid? tenantId = default(System.Guid?), string namespaceName = null, string namespaceNameSuffix = null, string hybridConnectionName = null, string accessKey = null, long? expiresOn = default(long?), string serviceConfigurationToken = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.ManagedProxyAsset ManagedProxyAsset(string proxy = null, long expiresOn = (long)0) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.ManagedProxyContent ManagedProxyContent(string service = null, string hostname = null, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName? serviceName = default(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName?)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.OperationStatusResult OperationStatusResult(Azure.Core.ResourceIdentifier id = null, Azure.Core.ResourceIdentifier resourceId = null, string name = null, string status = null, float? percentComplete = default(float?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable operations = null, Azure.ResponseError error = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorData PublicCloudConnectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.HybridConnectivity.Models.PublicCloudConnectorProperties properties = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.PublicCloudConnectorPatch PublicCloudConnectorPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable awsCloudExcludedAccounts = null, System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.PublicCloudConnectorProperties PublicCloudConnectorProperties(Azure.ResourceManager.HybridConnectivity.Models.AwsCloudProfile awsCloudProfile = null, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType hostType = default(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType), Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState? provisioningState = default(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState?), System.Guid? connectorPrimaryIdentifier = default(System.Guid?)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResourceData ServiceConfigurationResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName? serviceName = default(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName?), Azure.Core.ResourceIdentifier resourceId = null, long? port = default(long?), Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState? provisioningState = default(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState?)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.SolutionConfigurationData SolutionConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationProperties properties = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationPatch SolutionConfigurationPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationPropertiesUpdate properties = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationProperties SolutionConfigurationProperties(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState? provisioningState = default(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState?), string solutionType = null, System.Collections.Generic.IDictionary solutionSettings = null, Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus? status = default(Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus?), string statusDetails = null, System.DateTimeOffset? lastSyncOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.SolutionTypeResourceData SolutionTypeResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridConnectivity.Models.SolutionTypeProperties properties = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.SolutionTypeSettings SolutionTypeSettings(string solutionType = null, System.Collections.Generic.IDictionary solutionSettings = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.TargetResourceEndpointAccess TargetResourceEndpointAccess(string namespaceName = null, string namespaceNameSuffix = null, string hybridConnectionName = null, string accessKey = null, long? expiresOn = default(long?), string serviceConfigurationToken = null) { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct CreatedByType : System.IEquatable + public partial class AwsCloudProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public CreatedByType(string value) { throw null; } - public static Azure.ResourceManager.HybridConnectivity.Models.CreatedByType Application { get { throw null; } } - public static Azure.ResourceManager.HybridConnectivity.Models.CreatedByType Key { get { throw null; } } - public static Azure.ResourceManager.HybridConnectivity.Models.CreatedByType ManagedIdentity { get { throw null; } } - public static Azure.ResourceManager.HybridConnectivity.Models.CreatedByType User { get { throw null; } } - public bool Equals(Azure.ResourceManager.HybridConnectivity.Models.CreatedByType other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.HybridConnectivity.Models.CreatedByType left, Azure.ResourceManager.HybridConnectivity.Models.CreatedByType right) { throw null; } - public static implicit operator Azure.ResourceManager.HybridConnectivity.Models.CreatedByType (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.CreatedByType left, Azure.ResourceManager.HybridConnectivity.Models.CreatedByType right) { throw null; } - public override string ToString() { throw null; } + public AwsCloudProfile(string accountId) { } + public string AccountId { get { throw null; } set { } } + public System.Collections.Generic.IList ExcludedAccounts { get { throw null; } } + public bool? IsOrganizationalAccount { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.AwsCloudProfile 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.HybridConnectivity.Models.AwsCloudProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct EndpointType : System.IEquatable @@ -121,6 +417,362 @@ public static partial class ArmHybridConnectivityModelFactory public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.EndpointType left, Azure.ResourceManager.HybridConnectivity.Models.EndpointType right) { throw null; } public override string ToString() { throw null; } } + public partial class GenerateAwsTemplateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GenerateAwsTemplateContent(Azure.Core.ResourceIdentifier connectorId) { } + public Azure.Core.ResourceIdentifier ConnectorId { get { throw null; } } + public System.Collections.Generic.IList SolutionTypes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.GenerateAwsTemplateContent 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.HybridConnectivity.Models.GenerateAwsTemplateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HybridConnectivityCloudNativeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HybridConnectivityCloudNativeType(string value) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType Ec2 { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class HybridConnectivityEndpointProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HybridConnectivityEndpointProperties(Azure.ResourceManager.HybridConnectivity.Models.EndpointType endpointType) { } + public Azure.ResourceManager.HybridConnectivity.Models.EndpointType EndpointType { get { throw null; } set { } } + public string ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityEndpointProperties 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.HybridConnectivity.Models.HybridConnectivityEndpointProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HybridConnectivityHostType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HybridConnectivityHostType(string value) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType AWS { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class HybridConnectivityInventoryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HybridConnectivityInventoryProperties() { } + public Azure.Core.ResourceIdentifier AzureResourceId { get { throw null; } set { } } + public string CloudNativeResourceId { get { throw null; } set { } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType? CloudNativeType { get { throw null; } set { } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus? Status { get { throw null; } set { } } + public string StatusDetails { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityInventoryProperties 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.HybridConnectivity.Models.HybridConnectivityInventoryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HybridConnectivityProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HybridConnectivityProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HybridConnectivityResourceProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HybridConnectivityResourceProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HybridConnectivityServiceName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HybridConnectivityServiceName(string value) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName SSH { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName WAC { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName right) { throw null; } + public override string ToString() { throw null; } + } + public partial class IngressGatewayAsset : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal IngressGatewayAsset() { } + public string AccessKey { get { throw null; } } + public long? ExpiresOn { get { throw null; } } + public string Hostname { get { throw null; } } + public string HybridConnectionName { get { throw null; } } + public string NamespaceName { get { throw null; } } + public string NamespaceNameSuffix { get { throw null; } } + public Azure.Core.ResourceIdentifier ServerId { get { throw null; } } + public string ServiceConfigurationToken { get { throw null; } } + public System.Guid? TenantId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.IngressGatewayAsset 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.HybridConnectivity.Models.IngressGatewayAsset 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 ListCredentialsContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ListCredentialsContent() { } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName? ServiceName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.ListCredentialsContent 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.HybridConnectivity.Models.ListCredentialsContent 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 ListIngressGatewayCredentialsContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ListIngressGatewayCredentialsContent() { } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName? ServiceName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.ListIngressGatewayCredentialsContent 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.HybridConnectivity.Models.ListIngressGatewayCredentialsContent 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 ManagedProxyAsset : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ManagedProxyAsset() { } + public long ExpiresOn { get { throw null; } } + public string Proxy { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.ManagedProxyAsset 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.HybridConnectivity.Models.ManagedProxyAsset 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 ManagedProxyContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedProxyContent(string service) { } + public string Hostname { get { throw null; } set { } } + public string Service { get { throw null; } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName? ServiceName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.ManagedProxyContent 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.HybridConnectivity.Models.ManagedProxyContent 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 OperationStatusResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperationStatusResult() { } + public System.DateTimeOffset? EndOn { get { throw null; } } + public Azure.ResponseError Error { get { throw null; } } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } + public string Name { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Operations { get { throw null; } } + public float? PercentComplete { get { throw null; } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public string Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.OperationStatusResult 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.HybridConnectivity.Models.OperationStatusResult 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 PublicCloudConnectorPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PublicCloudConnectorPatch() { } + public System.Collections.Generic.IList AwsCloudExcludedAccounts { get { throw null; } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.PublicCloudConnectorPatch 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.HybridConnectivity.Models.PublicCloudConnectorPatch 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 PublicCloudConnectorProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PublicCloudConnectorProperties(Azure.ResourceManager.HybridConnectivity.Models.AwsCloudProfile awsCloudProfile, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType hostType) { } + public Azure.ResourceManager.HybridConnectivity.Models.AwsCloudProfile AwsCloudProfile { get { throw null; } set { } } + public System.Guid? ConnectorPrimaryIdentifier { get { throw null; } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType HostType { get { throw null; } set { } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.PublicCloudConnectorProperties 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.HybridConnectivity.Models.PublicCloudConnectorProperties 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 ServiceConfigurationResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServiceConfigurationResourcePatch() { } + public long? Port { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.ServiceConfigurationResourcePatch 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.HybridConnectivity.Models.ServiceConfigurationResourcePatch 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 SolutionConfigurationPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SolutionConfigurationPatch() { } + public Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationPropertiesUpdate Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationPatch 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.HybridConnectivity.Models.SolutionConfigurationPatch 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 SolutionConfigurationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SolutionConfigurationProperties(string solutionType) { } + public System.DateTimeOffset? LastSyncOn { get { throw null; } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IDictionary SolutionSettings { get { throw null; } } + public string SolutionType { get { throw null; } set { } } + public Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus? Status { get { throw null; } } + public string StatusDetails { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationProperties 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.HybridConnectivity.Models.SolutionConfigurationProperties 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 SolutionConfigurationPropertiesUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SolutionConfigurationPropertiesUpdate() { } + public System.Collections.Generic.IDictionary SolutionSettings { get { throw null; } } + public string SolutionType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationPropertiesUpdate 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.HybridConnectivity.Models.SolutionConfigurationPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SolutionConfigurationStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SolutionConfigurationStatus(string value) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus Completed { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus Failed { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus InProgress { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus New { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus left, Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus left, Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SolutionTypeProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SolutionTypeProperties() { } + public string Description { get { throw null; } set { } } + public System.Collections.Generic.IList SolutionSettings { get { throw null; } } + public string SolutionType { get { throw null; } set { } } + public System.Collections.Generic.IList SupportedAzureRegions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.SolutionTypeProperties 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.HybridConnectivity.Models.SolutionTypeProperties 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 SolutionTypeSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SolutionTypeSettings(string solutionType) { } + public System.Collections.Generic.IDictionary SolutionSettings { get { throw null; } } + public string SolutionType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.SolutionTypeSettings 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.HybridConnectivity.Models.SolutionTypeSettings 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 SolutionTypeSettingsProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SolutionTypeSettingsProperties(string name, string displayName, string solutionTypeSettingsPropertiesType, string description, System.Collections.Generic.IEnumerable allowedValues, string defaultValue) { } + public System.Collections.Generic.IList AllowedValues { get { throw null; } } + public string DefaultValue { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string SolutionTypeSettingsPropertiesType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.SolutionTypeSettingsProperties 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.HybridConnectivity.Models.SolutionTypeSettingsProperties 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 TargetResourceEndpointAccess : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal TargetResourceEndpointAccess() { } @@ -129,6 +781,7 @@ internal TargetResourceEndpointAccess() { } public string HybridConnectionName { get { throw null; } } public string NamespaceName { get { throw null; } } public string NamespaceNameSuffix { get { throw null; } } + public string ServiceConfigurationToken { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HybridConnectivity.Models.TargetResourceEndpointAccess 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) { } diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/api/Azure.ResourceManager.HybridConnectivity.netstandard2.0.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/api/Azure.ResourceManager.HybridConnectivity.netstandard2.0.cs index 6cf1e17715b84..4f5455a011f0f 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/api/Azure.ResourceManager.HybridConnectivity.netstandard2.0.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/api/Azure.ResourceManager.HybridConnectivity.netstandard2.0.cs @@ -11,8 +11,15 @@ protected EndpointResource() { } 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 GetCredentials(long? expiresin = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetCredentialsAsync(long? expiresin = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCredentials(Azure.ResourceManager.HybridConnectivity.Models.ListCredentialsContent content = null, long? expiresin = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCredentialsAsync(Azure.ResourceManager.HybridConnectivity.Models.ListCredentialsContent content = null, long? expiresin = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetIngressGatewayCredentials(Azure.ResourceManager.HybridConnectivity.Models.ListIngressGatewayCredentialsContent content = null, long? expiresin = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIngressGatewayCredentialsAsync(Azure.ResourceManager.HybridConnectivity.Models.ListIngressGatewayCredentialsContent content = null, long? expiresin = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetManagedProxyDetails(Azure.ResourceManager.HybridConnectivity.Models.ManagedProxyContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetManagedProxyDetailsAsync(Azure.ResourceManager.HybridConnectivity.Models.ManagedProxyContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetServiceConfigurationResource(string serviceConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetServiceConfigurationResourceAsync(string serviceConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResourceCollection GetServiceConfigurationResources() { throw null; } Azure.ResourceManager.HybridConnectivity.EndpointResourceData 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.HybridConnectivity.EndpointResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -41,15 +48,7 @@ protected EndpointResourceCollection() { } public partial class EndpointResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public EndpointResourceData() { } - public string CreatedBy { get { throw null; } set { } } - public Azure.ResourceManager.HybridConnectivity.Models.CreatedByType? CreatedByType { get { throw null; } set { } } - public System.DateTimeOffset? CreatedOn { get { throw null; } set { } } - public Azure.ResourceManager.HybridConnectivity.Models.EndpointType? EndpointType { get { throw null; } set { } } - public string LastModifiedBy { get { throw null; } set { } } - public Azure.ResourceManager.HybridConnectivity.Models.CreatedByType? LastModifiedByType { get { throw null; } set { } } - public System.DateTimeOffset? LastModifiedOn { get { throw null; } set { } } - public string ProvisioningState { get { throw null; } } - public string ResourceId { get { throw null; } set { } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityEndpointProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HybridConnectivity.EndpointResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -63,6 +62,265 @@ public static partial class HybridConnectivityExtensions public static Azure.Response GetEndpointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetEndpointResourceAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.HybridConnectivity.EndpointResourceCollection GetEndpointResources(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.HybridConnectivityInventoryResource GetHybridConnectivityInventoryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetPublicCloudConnector(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string publicCloudConnector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetPublicCloudConnectorAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string publicCloudConnector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorResource GetPublicCloudConnectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorCollection GetPublicCloudConnectors(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetPublicCloudConnectors(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetPublicCloudConnectorsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResource GetServiceConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetSolutionConfiguration(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string solutionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetSolutionConfigurationAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string solutionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.SolutionConfigurationResource GetSolutionConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.SolutionConfigurationCollection GetSolutionConfigurations(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.SolutionTypeResource GetSolutionTypeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetSolutionTypeResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string solutionType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetSolutionTypeResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string solutionType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.SolutionTypeResourceCollection GetSolutionTypeResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetSolutionTypeResources(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetSolutionTypeResourcesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response PostGenerateAwsTemplate(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.HybridConnectivity.Models.GenerateAwsTemplateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> PostGenerateAwsTemplateAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.HybridConnectivity.Models.GenerateAwsTemplateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class HybridConnectivityInventoryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected HybridConnectivityInventoryResource() { } + public virtual Azure.ResourceManager.HybridConnectivity.HybridConnectivityInventoryResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string solutionConfiguration, string inventoryId) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.HybridConnectivity.HybridConnectivityInventoryResourceData 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.HybridConnectivity.HybridConnectivityInventoryResourceData 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 HybridConnectivityInventoryResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected HybridConnectivityInventoryResourceCollection() { } + public virtual Azure.Response Exists(string inventoryId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string inventoryId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string inventoryId, 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 inventoryId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string inventoryId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string inventoryId, 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 HybridConnectivityInventoryResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HybridConnectivityInventoryResourceData() { } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityInventoryProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.HybridConnectivityInventoryResourceData 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.HybridConnectivity.HybridConnectivityInventoryResourceData 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 PublicCloudConnectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected PublicCloudConnectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string publicCloudConnector, Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string publicCloudConnector, Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string publicCloudConnector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string publicCloudConnector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string publicCloudConnector, 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 publicCloudConnector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string publicCloudConnector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string publicCloudConnector, 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 PublicCloudConnectorData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PublicCloudConnectorData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.HybridConnectivity.Models.PublicCloudConnectorProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorData 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.HybridConnectivity.PublicCloudConnectorData 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 PublicCloudConnectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected PublicCloudConnectorResource() { } + public virtual Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string publicCloudConnector) { 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 RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorData 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.HybridConnectivity.PublicCloudConnectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation TestPermissions(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> TestPermissionsAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.HybridConnectivity.Models.PublicCloudConnectorPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.HybridConnectivity.Models.PublicCloudConnectorPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ServiceConfigurationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ServiceConfigurationResource() { } + public virtual Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string scope, string endpointName, string serviceConfigurationName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResourceData 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.HybridConnectivity.ServiceConfigurationResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.HybridConnectivity.Models.ServiceConfigurationResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.HybridConnectivity.Models.ServiceConfigurationResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ServiceConfigurationResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ServiceConfigurationResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string serviceConfigurationName, Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string serviceConfigurationName, Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string serviceConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string serviceConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string serviceConfigurationName, 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 serviceConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string serviceConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string serviceConfigurationName, 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 ServiceConfigurationResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServiceConfigurationResourceData() { } + public long? Port { get { throw null; } set { } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName? ServiceName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResourceData 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.HybridConnectivity.ServiceConfigurationResourceData 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 SolutionConfigurationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected SolutionConfigurationCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string solutionConfiguration, Azure.ResourceManager.HybridConnectivity.SolutionConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string solutionConfiguration, Azure.ResourceManager.HybridConnectivity.SolutionConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string solutionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string solutionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string solutionConfiguration, 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 solutionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string solutionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string solutionConfiguration, 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 SolutionConfigurationData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SolutionConfigurationData() { } + public Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.SolutionConfigurationData 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.HybridConnectivity.SolutionConfigurationData 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 SolutionConfigurationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected SolutionConfigurationResource() { } + public virtual Azure.ResourceManager.HybridConnectivity.SolutionConfigurationData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string solutionConfiguration) { 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 GetHybridConnectivityInventoryResource(string inventoryId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetHybridConnectivityInventoryResourceAsync(string inventoryId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.HybridConnectivityInventoryResourceCollection GetHybridConnectivityInventoryResources() { throw null; } + public virtual Azure.ResourceManager.ArmOperation SyncNow(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SyncNowAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.HybridConnectivity.SolutionConfigurationData 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.HybridConnectivity.SolutionConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class SolutionTypeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected SolutionTypeResource() { } + public virtual Azure.ResourceManager.HybridConnectivity.SolutionTypeResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string solutionType) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.HybridConnectivity.SolutionTypeResourceData 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.HybridConnectivity.SolutionTypeResourceData 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 SolutionTypeResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected SolutionTypeResourceCollection() { } + public virtual Azure.Response Exists(string solutionType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string solutionType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string solutionType, 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 solutionType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string solutionType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string solutionType, 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 SolutionTypeResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SolutionTypeResourceData() { } + public Azure.ResourceManager.HybridConnectivity.Models.SolutionTypeProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.SolutionTypeResourceData 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.HybridConnectivity.SolutionTypeResourceData 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; } } } namespace Azure.ResourceManager.HybridConnectivity.Mocking @@ -74,34 +332,72 @@ protected MockableHybridConnectivityArmClient() { } public virtual Azure.Response GetEndpointResource(Azure.Core.ResourceIdentifier scope, string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetEndpointResourceAsync(Azure.Core.ResourceIdentifier scope, string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HybridConnectivity.EndpointResourceCollection GetEndpointResources(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.HybridConnectivityInventoryResource GetHybridConnectivityInventoryResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorResource GetPublicCloudConnectorResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResource GetServiceConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.Response GetSolutionConfiguration(Azure.Core.ResourceIdentifier scope, string solutionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetSolutionConfigurationAsync(Azure.Core.ResourceIdentifier scope, string solutionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.SolutionConfigurationResource GetSolutionConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.SolutionConfigurationCollection GetSolutionConfigurations(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.SolutionTypeResource GetSolutionTypeResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableHybridConnectivityResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableHybridConnectivityResourceGroupResource() { } + public virtual Azure.Response GetPublicCloudConnector(string publicCloudConnector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPublicCloudConnectorAsync(string publicCloudConnector, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorCollection GetPublicCloudConnectors() { throw null; } + public virtual Azure.Response GetSolutionTypeResource(string solutionType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetSolutionTypeResourceAsync(string solutionType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.HybridConnectivity.SolutionTypeResourceCollection GetSolutionTypeResources() { throw null; } + } + public partial class MockableHybridConnectivitySubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableHybridConnectivitySubscriptionResource() { } + public virtual Azure.Pageable GetPublicCloudConnectors(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetPublicCloudConnectorsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetSolutionTypeResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetSolutionTypeResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response PostGenerateAwsTemplate(Azure.ResourceManager.HybridConnectivity.Models.GenerateAwsTemplateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PostGenerateAwsTemplateAsync(Azure.ResourceManager.HybridConnectivity.Models.GenerateAwsTemplateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.HybridConnectivity.Models { public static partial class ArmHybridConnectivityModelFactory { - public static Azure.ResourceManager.HybridConnectivity.EndpointResourceData EndpointResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridConnectivity.Models.EndpointType? endpointType = default(Azure.ResourceManager.HybridConnectivity.Models.EndpointType?), string resourceId = null, string provisioningState = null, string createdBy = null, Azure.ResourceManager.HybridConnectivity.Models.CreatedByType? createdByType = default(Azure.ResourceManager.HybridConnectivity.Models.CreatedByType?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string lastModifiedBy = null, Azure.ResourceManager.HybridConnectivity.Models.CreatedByType? lastModifiedByType = default(Azure.ResourceManager.HybridConnectivity.Models.CreatedByType?), System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?)) { throw null; } - public static Azure.ResourceManager.HybridConnectivity.Models.TargetResourceEndpointAccess TargetResourceEndpointAccess(string namespaceName = null, string namespaceNameSuffix = null, string hybridConnectionName = null, string accessKey = null, long? expiresOn = default(long?)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.EndpointResourceData EndpointResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityEndpointProperties properties = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.GenerateAwsTemplateContent GenerateAwsTemplateContent(Azure.Core.ResourceIdentifier connectorId = null, System.Collections.Generic.IEnumerable solutionTypes = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityEndpointProperties HybridConnectivityEndpointProperties(Azure.ResourceManager.HybridConnectivity.Models.EndpointType endpointType = default(Azure.ResourceManager.HybridConnectivity.Models.EndpointType), Azure.Core.ResourceIdentifier resourceId = null, string provisioningState = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityInventoryProperties HybridConnectivityInventoryProperties(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType? cloudNativeType = default(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType?), string cloudNativeResourceId = null, Azure.Core.ResourceIdentifier azureResourceId = null, Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus? status = default(Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus?), string statusDetails = null, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState? provisioningState = default(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState?)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.HybridConnectivityInventoryResourceData HybridConnectivityInventoryResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityInventoryProperties properties = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.IngressGatewayAsset IngressGatewayAsset(string hostname = null, Azure.Core.ResourceIdentifier serverId = null, System.Guid? tenantId = default(System.Guid?), string namespaceName = null, string namespaceNameSuffix = null, string hybridConnectionName = null, string accessKey = null, long? expiresOn = default(long?), string serviceConfigurationToken = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.ManagedProxyAsset ManagedProxyAsset(string proxy = null, long expiresOn = (long)0) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.ManagedProxyContent ManagedProxyContent(string service = null, string hostname = null, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName? serviceName = default(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName?)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.OperationStatusResult OperationStatusResult(Azure.Core.ResourceIdentifier id = null, Azure.Core.ResourceIdentifier resourceId = null, string name = null, string status = null, float? percentComplete = default(float?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable operations = null, Azure.ResponseError error = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.PublicCloudConnectorData PublicCloudConnectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.HybridConnectivity.Models.PublicCloudConnectorProperties properties = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.PublicCloudConnectorPatch PublicCloudConnectorPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable awsCloudExcludedAccounts = null, System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.PublicCloudConnectorProperties PublicCloudConnectorProperties(Azure.ResourceManager.HybridConnectivity.Models.AwsCloudProfile awsCloudProfile = null, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType hostType = default(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType), Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState? provisioningState = default(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState?), System.Guid? connectorPrimaryIdentifier = default(System.Guid?)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.ServiceConfigurationResourceData ServiceConfigurationResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName? serviceName = default(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName?), Azure.Core.ResourceIdentifier resourceId = null, long? port = default(long?), Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState? provisioningState = default(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState?)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.SolutionConfigurationData SolutionConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationProperties properties = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationPatch SolutionConfigurationPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationPropertiesUpdate properties = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationProperties SolutionConfigurationProperties(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState? provisioningState = default(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState?), string solutionType = null, System.Collections.Generic.IDictionary solutionSettings = null, Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus? status = default(Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus?), string statusDetails = null, System.DateTimeOffset? lastSyncOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.SolutionTypeResourceData SolutionTypeResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridConnectivity.Models.SolutionTypeProperties properties = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.SolutionTypeSettings SolutionTypeSettings(string solutionType = null, System.Collections.Generic.IDictionary solutionSettings = null) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.TargetResourceEndpointAccess TargetResourceEndpointAccess(string namespaceName = null, string namespaceNameSuffix = null, string hybridConnectionName = null, string accessKey = null, long? expiresOn = default(long?), string serviceConfigurationToken = null) { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct CreatedByType : System.IEquatable + public partial class AwsCloudProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public CreatedByType(string value) { throw null; } - public static Azure.ResourceManager.HybridConnectivity.Models.CreatedByType Application { get { throw null; } } - public static Azure.ResourceManager.HybridConnectivity.Models.CreatedByType Key { get { throw null; } } - public static Azure.ResourceManager.HybridConnectivity.Models.CreatedByType ManagedIdentity { get { throw null; } } - public static Azure.ResourceManager.HybridConnectivity.Models.CreatedByType User { get { throw null; } } - public bool Equals(Azure.ResourceManager.HybridConnectivity.Models.CreatedByType other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.HybridConnectivity.Models.CreatedByType left, Azure.ResourceManager.HybridConnectivity.Models.CreatedByType right) { throw null; } - public static implicit operator Azure.ResourceManager.HybridConnectivity.Models.CreatedByType (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.CreatedByType left, Azure.ResourceManager.HybridConnectivity.Models.CreatedByType right) { throw null; } - public override string ToString() { throw null; } + public AwsCloudProfile(string accountId) { } + public string AccountId { get { throw null; } set { } } + public System.Collections.Generic.IList ExcludedAccounts { get { throw null; } } + public bool? IsOrganizationalAccount { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.AwsCloudProfile 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.HybridConnectivity.Models.AwsCloudProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct EndpointType : System.IEquatable @@ -121,6 +417,362 @@ public static partial class ArmHybridConnectivityModelFactory public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.EndpointType left, Azure.ResourceManager.HybridConnectivity.Models.EndpointType right) { throw null; } public override string ToString() { throw null; } } + public partial class GenerateAwsTemplateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GenerateAwsTemplateContent(Azure.Core.ResourceIdentifier connectorId) { } + public Azure.Core.ResourceIdentifier ConnectorId { get { throw null; } } + public System.Collections.Generic.IList SolutionTypes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.GenerateAwsTemplateContent 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.HybridConnectivity.Models.GenerateAwsTemplateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HybridConnectivityCloudNativeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HybridConnectivityCloudNativeType(string value) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType Ec2 { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class HybridConnectivityEndpointProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HybridConnectivityEndpointProperties(Azure.ResourceManager.HybridConnectivity.Models.EndpointType endpointType) { } + public Azure.ResourceManager.HybridConnectivity.Models.EndpointType EndpointType { get { throw null; } set { } } + public string ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityEndpointProperties 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.HybridConnectivity.Models.HybridConnectivityEndpointProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HybridConnectivityHostType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HybridConnectivityHostType(string value) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType AWS { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class HybridConnectivityInventoryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HybridConnectivityInventoryProperties() { } + public Azure.Core.ResourceIdentifier AzureResourceId { get { throw null; } set { } } + public string CloudNativeResourceId { get { throw null; } set { } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityCloudNativeType? CloudNativeType { get { throw null; } set { } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus? Status { get { throw null; } set { } } + public string StatusDetails { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityInventoryProperties 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.HybridConnectivity.Models.HybridConnectivityInventoryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HybridConnectivityProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HybridConnectivityProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HybridConnectivityResourceProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HybridConnectivityResourceProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HybridConnectivityServiceName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HybridConnectivityServiceName(string value) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName SSH { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName WAC { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName left, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName right) { throw null; } + public override string ToString() { throw null; } + } + public partial class IngressGatewayAsset : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal IngressGatewayAsset() { } + public string AccessKey { get { throw null; } } + public long? ExpiresOn { get { throw null; } } + public string Hostname { get { throw null; } } + public string HybridConnectionName { get { throw null; } } + public string NamespaceName { get { throw null; } } + public string NamespaceNameSuffix { get { throw null; } } + public Azure.Core.ResourceIdentifier ServerId { get { throw null; } } + public string ServiceConfigurationToken { get { throw null; } } + public System.Guid? TenantId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.IngressGatewayAsset 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.HybridConnectivity.Models.IngressGatewayAsset 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 ListCredentialsContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ListCredentialsContent() { } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName? ServiceName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.ListCredentialsContent 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.HybridConnectivity.Models.ListCredentialsContent 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 ListIngressGatewayCredentialsContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ListIngressGatewayCredentialsContent() { } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName? ServiceName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.ListIngressGatewayCredentialsContent 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.HybridConnectivity.Models.ListIngressGatewayCredentialsContent 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 ManagedProxyAsset : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ManagedProxyAsset() { } + public long ExpiresOn { get { throw null; } } + public string Proxy { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.ManagedProxyAsset 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.HybridConnectivity.Models.ManagedProxyAsset 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 ManagedProxyContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedProxyContent(string service) { } + public string Hostname { get { throw null; } set { } } + public string Service { get { throw null; } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityServiceName? ServiceName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.ManagedProxyContent 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.HybridConnectivity.Models.ManagedProxyContent 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 OperationStatusResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperationStatusResult() { } + public System.DateTimeOffset? EndOn { get { throw null; } } + public Azure.ResponseError Error { get { throw null; } } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } + public string Name { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Operations { get { throw null; } } + public float? PercentComplete { get { throw null; } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public string Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.OperationStatusResult 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.HybridConnectivity.Models.OperationStatusResult 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 PublicCloudConnectorPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PublicCloudConnectorPatch() { } + public System.Collections.Generic.IList AwsCloudExcludedAccounts { get { throw null; } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.PublicCloudConnectorPatch 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.HybridConnectivity.Models.PublicCloudConnectorPatch 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 PublicCloudConnectorProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PublicCloudConnectorProperties(Azure.ResourceManager.HybridConnectivity.Models.AwsCloudProfile awsCloudProfile, Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType hostType) { } + public Azure.ResourceManager.HybridConnectivity.Models.AwsCloudProfile AwsCloudProfile { get { throw null; } set { } } + public System.Guid? ConnectorPrimaryIdentifier { get { throw null; } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityHostType HostType { get { throw null; } set { } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.PublicCloudConnectorProperties 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.HybridConnectivity.Models.PublicCloudConnectorProperties 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 ServiceConfigurationResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServiceConfigurationResourcePatch() { } + public long? Port { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.ServiceConfigurationResourcePatch 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.HybridConnectivity.Models.ServiceConfigurationResourcePatch 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 SolutionConfigurationPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SolutionConfigurationPatch() { } + public Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationPropertiesUpdate Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationPatch 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.HybridConnectivity.Models.SolutionConfigurationPatch 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 SolutionConfigurationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SolutionConfigurationProperties(string solutionType) { } + public System.DateTimeOffset? LastSyncOn { get { throw null; } } + public Azure.ResourceManager.HybridConnectivity.Models.HybridConnectivityResourceProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IDictionary SolutionSettings { get { throw null; } } + public string SolutionType { get { throw null; } set { } } + public Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus? Status { get { throw null; } } + public string StatusDetails { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationProperties 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.HybridConnectivity.Models.SolutionConfigurationProperties 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 SolutionConfigurationPropertiesUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SolutionConfigurationPropertiesUpdate() { } + public System.Collections.Generic.IDictionary SolutionSettings { get { throw null; } } + public string SolutionType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationPropertiesUpdate 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.HybridConnectivity.Models.SolutionConfigurationPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SolutionConfigurationStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SolutionConfigurationStatus(string value) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus Completed { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus Failed { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus InProgress { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus New { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus left, Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus left, Azure.ResourceManager.HybridConnectivity.Models.SolutionConfigurationStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SolutionTypeProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SolutionTypeProperties() { } + public string Description { get { throw null; } set { } } + public System.Collections.Generic.IList SolutionSettings { get { throw null; } } + public string SolutionType { get { throw null; } set { } } + public System.Collections.Generic.IList SupportedAzureRegions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.SolutionTypeProperties 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.HybridConnectivity.Models.SolutionTypeProperties 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 SolutionTypeSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SolutionTypeSettings(string solutionType) { } + public System.Collections.Generic.IDictionary SolutionSettings { get { throw null; } } + public string SolutionType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.SolutionTypeSettings 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.HybridConnectivity.Models.SolutionTypeSettings 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 SolutionTypeSettingsProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SolutionTypeSettingsProperties(string name, string displayName, string solutionTypeSettingsPropertiesType, string description, System.Collections.Generic.IEnumerable allowedValues, string defaultValue) { } + public System.Collections.Generic.IList AllowedValues { get { throw null; } } + public string DefaultValue { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string SolutionTypeSettingsPropertiesType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridConnectivity.Models.SolutionTypeSettingsProperties 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.HybridConnectivity.Models.SolutionTypeSettingsProperties 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 TargetResourceEndpointAccess : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal TargetResourceEndpointAccess() { } @@ -129,6 +781,7 @@ internal TargetResourceEndpointAccess() { } public string HybridConnectionName { get { throw null; } } public string NamespaceName { get { throw null; } } public string NamespaceNameSuffix { get { throw null; } } + public string ServiceConfigurationToken { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HybridConnectivity.Models.TargetResourceEndpointAccess 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) { } diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_EndpointResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_EndpointResource.cs index 6df343018fb32..930dc9edbedca 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_EndpointResource.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_EndpointResource.cs @@ -20,7 +20,7 @@ public partial class Sample_EndpointResource [Ignore("Only validating compilation of examples")] public async Task Get_HybridConnectivityEndpointsGetCustom() { - // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2021-10-06-preview/examples/EndpointsGetCustom.json + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/EndpointsGetCustom.json // this example is just showing the usage of "Endpoints_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 @@ -49,7 +49,7 @@ public async Task Get_HybridConnectivityEndpointsGetCustom() [Ignore("Only validating compilation of examples")] public async Task Get_HybridConnectivityEndpointsGetDefault() { - // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2021-10-06-preview/examples/EndpointsGetDefault.json + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/EndpointsGetDefault.json // this example is just showing the usage of "Endpoints_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 @@ -78,7 +78,7 @@ public async Task Get_HybridConnectivityEndpointsGetDefault() [Ignore("Only validating compilation of examples")] public async Task Update_HybridConnectivityEndpointsPatchDefault() { - // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2021-10-06-preview/examples/EndpointsPatchDefault.json + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/EndpointsPatchDefault.json // this example is just showing the usage of "Endpoints_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 @@ -96,7 +96,7 @@ public async Task Update_HybridConnectivityEndpointsPatchDefault() // invoke the operation EndpointResourceData data = new EndpointResourceData() { - EndpointType = EndpointType.Default, + Properties = new HybridConnectivityEndpointProperties(EndpointType.Default), }; EndpointResource result = await endpointResource.UpdateAsync(data); @@ -111,7 +111,7 @@ public async Task Update_HybridConnectivityEndpointsPatchDefault() [Ignore("Only validating compilation of examples")] public async Task Delete_HybridConnectivityEndpointsDeleteDefault() { - // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2021-10-06-preview/examples/EndpointsDeleteDefault.json + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/EndpointsDeleteDefault.json // this example is just showing the usage of "Endpoints_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 @@ -136,7 +136,7 @@ public async Task Delete_HybridConnectivityEndpointsDeleteDefault() [Ignore("Only validating compilation of examples")] public async Task GetCredentials_HybridConnectivityEndpointsPostListCredentials() { - // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2021-10-06-preview/examples/EndpointsPostListCredentials.json + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/EndpointsPostListCredentials.json // this example is just showing the usage of "Endpoints_ListCredentials" 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 @@ -151,9 +151,69 @@ public async Task GetCredentials_HybridConnectivityEndpointsPostListCredentials( ResourceIdentifier endpointResourceId = EndpointResource.CreateResourceIdentifier(scope, endpointName); EndpointResource endpointResource = client.GetEndpointResource(endpointResourceId); + // invoke the operation + ListCredentialsContent content = new ListCredentialsContent() + { + ServiceName = HybridConnectivityServiceName.SSH, + }; + long? expiresin = 10800L; + TargetResourceEndpointAccess result = await endpointResource.GetCredentialsAsync(content: content, expiresin: expiresin); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIngressGatewayCredentials_HybridConnectivityEndpointsPostListIngressGatewayCredentials() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/EndpointsPostListIngressGatewayCredentials.json + // this example is just showing the usage of "Endpoints_ListIngressGatewayCredentials" 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 EndpointResource created on azure + // for more information of creating EndpointResource, please refer to the document of EndpointResource + string scope = "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/arcGroup/providers/Microsoft.ArcPlaceHolder/ProvisionedClusters/cluster0"; + string endpointName = "default"; + ResourceIdentifier endpointResourceId = EndpointResource.CreateResourceIdentifier(scope, endpointName); + EndpointResource endpointResource = client.GetEndpointResource(endpointResourceId); + // invoke the operation long? expiresin = 10800L; - TargetResourceEndpointAccess result = await endpointResource.GetCredentialsAsync(expiresin: expiresin); + IngressGatewayAsset result = await endpointResource.GetIngressGatewayCredentialsAsync(expiresin: expiresin); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetManagedProxyDetails_HybridConnectivityEndpointsPostListManagedProxyDetails() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/EndpointsPostListManagedProxyDetails.json + // this example is just showing the usage of "Endpoints_ListManagedProxyDetails" 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 EndpointResource created on azure + // for more information of creating EndpointResource, please refer to the document of EndpointResource + string scope = "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/arcGroup/providers/Microsoft.Compute/virtualMachines/vm00006"; + string endpointName = "default"; + ResourceIdentifier endpointResourceId = EndpointResource.CreateResourceIdentifier(scope, endpointName); + EndpointResource endpointResource = client.GetEndpointResource(endpointResourceId); + + // invoke the operation + ManagedProxyContent content = new ManagedProxyContent("127.0.0.1:65035") + { + Hostname = "r.proxy.arc.com", + ServiceName = HybridConnectivityServiceName.WAC, + }; + ManagedProxyAsset result = await endpointResource.GetManagedProxyDetailsAsync(content); Console.WriteLine($"Succeeded: {result}"); } diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_EndpointResourceCollection.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_EndpointResourceCollection.cs index 9b5aa2a78d0b2..4b885bc400319 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_EndpointResourceCollection.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_EndpointResourceCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_EndpointResourceCollection [Ignore("Only validating compilation of examples")] public async Task GetAll_HybridConnectivityEndpointsGet() { - // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2021-10-06-preview/examples/EndpointsList.json + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/EndpointsList.json // this example is just showing the usage of "Endpoints_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 @@ -53,7 +53,7 @@ public async Task GetAll_HybridConnectivityEndpointsGet() [Ignore("Only validating compilation of examples")] public async Task Get_HybridConnectivityEndpointsGetCustom() { - // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2021-10-06-preview/examples/EndpointsGetCustom.json + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/EndpointsGetCustom.json // this example is just showing the usage of "Endpoints_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 @@ -84,7 +84,7 @@ public async Task Get_HybridConnectivityEndpointsGetCustom() [Ignore("Only validating compilation of examples")] public async Task Exists_HybridConnectivityEndpointsGetCustom() { - // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2021-10-06-preview/examples/EndpointsGetCustom.json + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/EndpointsGetCustom.json // this example is just showing the usage of "Endpoints_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 @@ -111,7 +111,7 @@ public async Task Exists_HybridConnectivityEndpointsGetCustom() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_HybridConnectivityEndpointsGetCustom() { - // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2021-10-06-preview/examples/EndpointsGetCustom.json + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/EndpointsGetCustom.json // this example is just showing the usage of "Endpoints_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 @@ -150,7 +150,7 @@ public async Task GetIfExists_HybridConnectivityEndpointsGetCustom() [Ignore("Only validating compilation of examples")] public async Task Get_HybridConnectivityEndpointsGetDefault() { - // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2021-10-06-preview/examples/EndpointsGetDefault.json + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/EndpointsGetDefault.json // this example is just showing the usage of "Endpoints_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 @@ -181,7 +181,7 @@ public async Task Get_HybridConnectivityEndpointsGetDefault() [Ignore("Only validating compilation of examples")] public async Task Exists_HybridConnectivityEndpointsGetDefault() { - // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2021-10-06-preview/examples/EndpointsGetDefault.json + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/EndpointsGetDefault.json // this example is just showing the usage of "Endpoints_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 @@ -208,7 +208,7 @@ public async Task Exists_HybridConnectivityEndpointsGetDefault() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_HybridConnectivityEndpointsGetDefault() { - // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2021-10-06-preview/examples/EndpointsGetDefault.json + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/EndpointsGetDefault.json // this example is just showing the usage of "Endpoints_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 @@ -247,7 +247,7 @@ public async Task GetIfExists_HybridConnectivityEndpointsGetDefault() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_HybridConnectivityEndpointsPutCustom() { - // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2021-10-06-preview/examples/EndpointsPutCustom.json + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/EndpointsPutCustom.json // this example is just showing the usage of "Endpoints_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 @@ -267,8 +267,10 @@ public async Task CreateOrUpdate_HybridConnectivityEndpointsPutCustom() string endpointName = "custom"; EndpointResourceData data = new EndpointResourceData() { - EndpointType = EndpointType.Custom, - ResourceId = "/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.Relay/namespaces/custom-relay-namespace", + Properties = new HybridConnectivityEndpointProperties(EndpointType.Custom) + { + ResourceId = new ResourceIdentifier("/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.Relay/namespaces/custom-relay-namespace"), + }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, endpointName, data); EndpointResource result = lro.Value; @@ -284,7 +286,7 @@ public async Task CreateOrUpdate_HybridConnectivityEndpointsPutCustom() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_HybridConnectivityEndpointsPutDefault() { - // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/preview/2021-10-06-preview/examples/EndpointsPutDefault.json + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/EndpointsPutDefault.json // this example is just showing the usage of "Endpoints_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 @@ -304,7 +306,7 @@ public async Task CreateOrUpdate_HybridConnectivityEndpointsPutDefault() string endpointName = "default"; EndpointResourceData data = new EndpointResourceData() { - EndpointType = EndpointType.Default, + Properties = new HybridConnectivityEndpointProperties(EndpointType.Default), }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, endpointName, data); EndpointResource result = lro.Value; diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_HybridConnectivityInventoryResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_HybridConnectivityInventoryResource.cs new file mode 100644 index 0000000000000..ba2d526e1d529 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_HybridConnectivityInventoryResource.cs @@ -0,0 +1,48 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.HybridConnectivity.Samples +{ + public partial class Sample_HybridConnectivityInventoryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_InventoryGet() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/Inventory_Get.json + // this example is just showing the usage of "Inventory_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 HybridConnectivityInventoryResource created on azure + // for more information of creating HybridConnectivityInventoryResource, please refer to the document of HybridConnectivityInventoryResource + string resourceUri = "ymuj"; + string solutionConfiguration = "zarfsraogroxlaqjjnwixtn"; + string inventoryId = "xofprmcboosrbd"; + ResourceIdentifier hybridConnectivityInventoryResourceId = HybridConnectivityInventoryResource.CreateResourceIdentifier(resourceUri, solutionConfiguration, inventoryId); + HybridConnectivityInventoryResource hybridConnectivityInventoryResource = client.GetHybridConnectivityInventoryResource(hybridConnectivityInventoryResourceId); + + // invoke the operation + HybridConnectivityInventoryResource result = await hybridConnectivityInventoryResource.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 + HybridConnectivityInventoryResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_HybridConnectivityInventoryResourceCollection.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_HybridConnectivityInventoryResourceCollection.cs new file mode 100644 index 0000000000000..052005a08fec7 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_HybridConnectivityInventoryResourceCollection.cs @@ -0,0 +1,156 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.HybridConnectivity.Samples +{ + public partial class Sample_HybridConnectivityInventoryResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_InventoryListBySolutionConfiguration() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/Inventory_ListBySolutionConfiguration.json + // this example is just showing the usage of "Inventory_ListBySolutionConfiguration" 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 SolutionConfigurationResource created on azure + // for more information of creating SolutionConfigurationResource, please refer to the document of SolutionConfigurationResource + string resourceUri = "ymuj"; + string solutionConfiguration = "wsxt"; + ResourceIdentifier solutionConfigurationResourceId = SolutionConfigurationResource.CreateResourceIdentifier(resourceUri, solutionConfiguration); + SolutionConfigurationResource solutionConfiguration0 = client.GetSolutionConfigurationResource(solutionConfigurationResourceId); + + // get the collection of this HybridConnectivityInventoryResource + HybridConnectivityInventoryResourceCollection collection = solutionConfiguration0.GetHybridConnectivityInventoryResources(); + + // invoke the operation and iterate over the result + await foreach (HybridConnectivityInventoryResource 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 + HybridConnectivityInventoryResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_InventoryGet() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/Inventory_Get.json + // this example is just showing the usage of "Inventory_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 SolutionConfigurationResource created on azure + // for more information of creating SolutionConfigurationResource, please refer to the document of SolutionConfigurationResource + string resourceUri = "ymuj"; + string solutionConfiguration = "zarfsraogroxlaqjjnwixtn"; + ResourceIdentifier solutionConfigurationResourceId = SolutionConfigurationResource.CreateResourceIdentifier(resourceUri, solutionConfiguration); + SolutionConfigurationResource solutionConfiguration0 = client.GetSolutionConfigurationResource(solutionConfigurationResourceId); + + // get the collection of this HybridConnectivityInventoryResource + HybridConnectivityInventoryResourceCollection collection = solutionConfiguration0.GetHybridConnectivityInventoryResources(); + + // invoke the operation + string inventoryId = "xofprmcboosrbd"; + HybridConnectivityInventoryResource result = await collection.GetAsync(inventoryId); + + // 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 + HybridConnectivityInventoryResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_InventoryGet() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/Inventory_Get.json + // this example is just showing the usage of "Inventory_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 SolutionConfigurationResource created on azure + // for more information of creating SolutionConfigurationResource, please refer to the document of SolutionConfigurationResource + string resourceUri = "ymuj"; + string solutionConfiguration = "zarfsraogroxlaqjjnwixtn"; + ResourceIdentifier solutionConfigurationResourceId = SolutionConfigurationResource.CreateResourceIdentifier(resourceUri, solutionConfiguration); + SolutionConfigurationResource solutionConfiguration0 = client.GetSolutionConfigurationResource(solutionConfigurationResourceId); + + // get the collection of this HybridConnectivityInventoryResource + HybridConnectivityInventoryResourceCollection collection = solutionConfiguration0.GetHybridConnectivityInventoryResources(); + + // invoke the operation + string inventoryId = "xofprmcboosrbd"; + bool result = await collection.ExistsAsync(inventoryId); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_InventoryGet() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/Inventory_Get.json + // this example is just showing the usage of "Inventory_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 SolutionConfigurationResource created on azure + // for more information of creating SolutionConfigurationResource, please refer to the document of SolutionConfigurationResource + string resourceUri = "ymuj"; + string solutionConfiguration = "zarfsraogroxlaqjjnwixtn"; + ResourceIdentifier solutionConfigurationResourceId = SolutionConfigurationResource.CreateResourceIdentifier(resourceUri, solutionConfiguration); + SolutionConfigurationResource solutionConfiguration0 = client.GetSolutionConfigurationResource(solutionConfigurationResourceId); + + // get the collection of this HybridConnectivityInventoryResource + HybridConnectivityInventoryResourceCollection collection = solutionConfiguration0.GetHybridConnectivityInventoryResources(); + + // invoke the operation + string inventoryId = "xofprmcboosrbd"; + NullableResponse response = await collection.GetIfExistsAsync(inventoryId); + HybridConnectivityInventoryResource 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 + HybridConnectivityInventoryResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_PublicCloudConnectorCollection.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_PublicCloudConnectorCollection.cs new file mode 100644 index 0000000000000..a6377c1c7e363 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_PublicCloudConnectorCollection.cs @@ -0,0 +1,206 @@ +// 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.HybridConnectivity.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.HybridConnectivity.Samples +{ + public partial class Sample_PublicCloudConnectorCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_PublicCloudConnectorsListByResourceGroup() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/PublicCloudConnectors_ListByResourceGroup.json + // this example is just showing the usage of "PublicCloudConnectors_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + string resourceGroupName = "rgpublicCloud"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PublicCloudConnectorResource + PublicCloudConnectorCollection collection = resourceGroupResource.GetPublicCloudConnectors(); + + // invoke the operation and iterate over the result + await foreach (PublicCloudConnectorResource 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 + PublicCloudConnectorData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PublicCloudConnectorsGet() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/PublicCloudConnectors_Get.json + // this example is just showing the usage of "PublicCloudConnectors_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + string resourceGroupName = "rgpublicCloud"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PublicCloudConnectorResource + PublicCloudConnectorCollection collection = resourceGroupResource.GetPublicCloudConnectors(); + + // invoke the operation + string publicCloudConnector = "rzygvnpsnrdylwzdbsscjazvamyxmh"; + PublicCloudConnectorResource result = await collection.GetAsync(publicCloudConnector); + + // 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 + PublicCloudConnectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_PublicCloudConnectorsGet() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/PublicCloudConnectors_Get.json + // this example is just showing the usage of "PublicCloudConnectors_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + string resourceGroupName = "rgpublicCloud"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PublicCloudConnectorResource + PublicCloudConnectorCollection collection = resourceGroupResource.GetPublicCloudConnectors(); + + // invoke the operation + string publicCloudConnector = "rzygvnpsnrdylwzdbsscjazvamyxmh"; + bool result = await collection.ExistsAsync(publicCloudConnector); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_PublicCloudConnectorsGet() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/PublicCloudConnectors_Get.json + // this example is just showing the usage of "PublicCloudConnectors_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + string resourceGroupName = "rgpublicCloud"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PublicCloudConnectorResource + PublicCloudConnectorCollection collection = resourceGroupResource.GetPublicCloudConnectors(); + + // invoke the operation + string publicCloudConnector = "rzygvnpsnrdylwzdbsscjazvamyxmh"; + NullableResponse response = await collection.GetIfExistsAsync(publicCloudConnector); + PublicCloudConnectorResource 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 + PublicCloudConnectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PublicCloudConnectorsCreateOrUpdate() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/PublicCloudConnectors_CreateOrUpdate.json + // this example is just showing the usage of "PublicCloudConnectors_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + string resourceGroupName = "rgpublicCloud"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PublicCloudConnectorResource + PublicCloudConnectorCollection collection = resourceGroupResource.GetPublicCloudConnectors(); + + // invoke the operation + string publicCloudConnector = "advjwoakdusalamomg"; + PublicCloudConnectorData data = new PublicCloudConnectorData(new AzureLocation("jpiglusfxynfcewcjwvvnn")) + { + Properties = new PublicCloudConnectorProperties(new AwsCloudProfile("snbnuxckevyqpm") + { + ExcludedAccounts = +{ +"rwgqpukglvbqmogqcliqolucp" +}, + IsOrganizationalAccount = true, + }, HybridConnectivityHostType.AWS), + Tags = +{ +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, publicCloudConnector, data); + PublicCloudConnectorResource 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 + PublicCloudConnectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_PublicCloudConnectorResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_PublicCloudConnectorResource.cs new file mode 100644 index 0000000000000..57d788522afe3 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_PublicCloudConnectorResource.cs @@ -0,0 +1,174 @@ +// 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.HybridConnectivity.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.HybridConnectivity.Samples +{ + public partial class Sample_PublicCloudConnectorResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetPublicCloudConnectors_PublicCloudConnectorsListBySubscription() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/PublicCloudConnectors_ListBySubscription.json + // this example is just showing the usage of "PublicCloudConnectors_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (PublicCloudConnectorResource item in subscriptionResource.GetPublicCloudConnectorsAsync()) + { + // 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 + PublicCloudConnectorData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PublicCloudConnectorsGet() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/PublicCloudConnectors_Get.json + // this example is just showing the usage of "PublicCloudConnectors_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 PublicCloudConnectorResource created on azure + // for more information of creating PublicCloudConnectorResource, please refer to the document of PublicCloudConnectorResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + string resourceGroupName = "rgpublicCloud"; + string publicCloudConnector = "rzygvnpsnrdylwzdbsscjazvamyxmh"; + ResourceIdentifier publicCloudConnectorResourceId = PublicCloudConnectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, publicCloudConnector); + PublicCloudConnectorResource publicCloudConnector0 = client.GetPublicCloudConnectorResource(publicCloudConnectorResourceId); + + // invoke the operation + PublicCloudConnectorResource result = await publicCloudConnector0.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 + PublicCloudConnectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PublicCloudConnectorsUpdate() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/PublicCloudConnectors_Update.json + // this example is just showing the usage of "PublicCloudConnectors_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 PublicCloudConnectorResource created on azure + // for more information of creating PublicCloudConnectorResource, please refer to the document of PublicCloudConnectorResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + string resourceGroupName = "rgpublicCloud"; + string publicCloudConnector = "svtirlbyqpepbzyessjenlueeznhg"; + ResourceIdentifier publicCloudConnectorResourceId = PublicCloudConnectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, publicCloudConnector); + PublicCloudConnectorResource publicCloudConnector0 = client.GetPublicCloudConnectorResource(publicCloudConnectorResourceId); + + // invoke the operation + PublicCloudConnectorPatch patch = new PublicCloudConnectorPatch() + { + AwsCloudExcludedAccounts = +{ +"zrbtd" +}, + Tags = +{ +}, + }; + PublicCloudConnectorResource result = await publicCloudConnector0.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PublicCloudConnectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_PublicCloudConnectorsDelete() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/PublicCloudConnectors_Delete.json + // this example is just showing the usage of "PublicCloudConnectors_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 PublicCloudConnectorResource created on azure + // for more information of creating PublicCloudConnectorResource, please refer to the document of PublicCloudConnectorResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + string resourceGroupName = "rgpublicCloud"; + string publicCloudConnector = "skcfyjvflkhibdywjay"; + ResourceIdentifier publicCloudConnectorResourceId = PublicCloudConnectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, publicCloudConnector); + PublicCloudConnectorResource publicCloudConnector0 = client.GetPublicCloudConnectorResource(publicCloudConnectorResourceId); + + // invoke the operation + await publicCloudConnector0.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task TestPermissions_PublicCloudConnectorsTestPermissions() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/PublicCloudConnectors_TestPermissions.json + // this example is just showing the usage of "PublicCloudConnectors_TestPermissions" 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 PublicCloudConnectorResource created on azure + // for more information of creating PublicCloudConnectorResource, please refer to the document of PublicCloudConnectorResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + string resourceGroupName = "rgpublicCloud"; + string publicCloudConnector = "rzygvnpsnrdylwzdbsscjazvamyxmh"; + ResourceIdentifier publicCloudConnectorResourceId = PublicCloudConnectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, publicCloudConnector); + PublicCloudConnectorResource publicCloudConnector0 = client.GetPublicCloudConnectorResource(publicCloudConnectorResourceId); + + // invoke the operation + ArmOperation lro = await publicCloudConnector0.TestPermissionsAsync(WaitUntil.Completed); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_ServiceConfigurationResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_ServiceConfigurationResource.cs new file mode 100644 index 0000000000000..d6ed0eb5b9e96 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_ServiceConfigurationResource.cs @@ -0,0 +1,139 @@ +// 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.HybridConnectivity.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.HybridConnectivity.Samples +{ + public partial class Sample_ServiceConfigurationResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HybridConnectivityEndpointsServiceconfigurationsGetSSH() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/ServiceConfigurationsGetSSH.json + // this example is just showing the usage of "ServiceConfigurations_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 ServiceConfigurationResource created on azure + // for more information of creating ServiceConfigurationResource, please refer to the document of ServiceConfigurationResource + string scope = "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default"; + string endpointName = "default"; + string serviceConfigurationName = "SSH"; + ResourceIdentifier serviceConfigurationResourceId = ServiceConfigurationResource.CreateResourceIdentifier(scope, endpointName, serviceConfigurationName); + ServiceConfigurationResource serviceConfigurationResource = client.GetServiceConfigurationResource(serviceConfigurationResourceId); + + // invoke the operation + ServiceConfigurationResource result = await serviceConfigurationResource.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 + ServiceConfigurationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HybridConnectivityEndpointsServiceconfigurationsGetWAC() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/ServiceConfigurationsGetWAC.json + // this example is just showing the usage of "ServiceConfigurations_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 ServiceConfigurationResource created on azure + // for more information of creating ServiceConfigurationResource, please refer to the document of ServiceConfigurationResource + string scope = "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default"; + string endpointName = "default"; + string serviceConfigurationName = "WAC"; + ResourceIdentifier serviceConfigurationResourceId = ServiceConfigurationResource.CreateResourceIdentifier(scope, endpointName, serviceConfigurationName); + ServiceConfigurationResource serviceConfigurationResource = client.GetServiceConfigurationResource(serviceConfigurationResourceId); + + // invoke the operation + ServiceConfigurationResource result = await serviceConfigurationResource.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 + ServiceConfigurationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ServiceConfigurationsPatchSSH() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/ServiceConfigurationsPatchSSH.json + // this example is just showing the usage of "ServiceConfigurations_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 ServiceConfigurationResource created on azure + // for more information of creating ServiceConfigurationResource, please refer to the document of ServiceConfigurationResource + string scope = "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default"; + string endpointName = "default"; + string serviceConfigurationName = "SSH"; + ResourceIdentifier serviceConfigurationResourceId = ServiceConfigurationResource.CreateResourceIdentifier(scope, endpointName, serviceConfigurationName); + ServiceConfigurationResource serviceConfigurationResource = client.GetServiceConfigurationResource(serviceConfigurationResourceId); + + // invoke the operation + ServiceConfigurationResourcePatch patch = new ServiceConfigurationResourcePatch() + { + Port = 22L, + }; + ServiceConfigurationResource result = await serviceConfigurationResource.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServiceConfigurationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ServiceConfigurationsDeleteSSH() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/ServiceConfigurationsDeleteSSH.json + // this example is just showing the usage of "ServiceConfigurations_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 ServiceConfigurationResource created on azure + // for more information of creating ServiceConfigurationResource, please refer to the document of ServiceConfigurationResource + string scope = "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default"; + string endpointName = "default"; + string serviceConfigurationName = "SSH"; + ResourceIdentifier serviceConfigurationResourceId = ServiceConfigurationResource.CreateResourceIdentifier(scope, endpointName, serviceConfigurationName); + ServiceConfigurationResource serviceConfigurationResource = client.GetServiceConfigurationResource(serviceConfigurationResourceId); + + // invoke the operation + await serviceConfigurationResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_ServiceConfigurationResourceCollection.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_ServiceConfigurationResourceCollection.cs new file mode 100644 index 0000000000000..6b89abbd4c539 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_ServiceConfigurationResourceCollection.cs @@ -0,0 +1,338 @@ +// 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.HybridConnectivity.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.HybridConnectivity.Samples +{ + public partial class Sample_ServiceConfigurationResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_GetClustersExample() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/ServiceConfigurationsList.json + // this example is just showing the usage of "ServiceConfigurations_ListByEndpointResource" 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 EndpointResource created on azure + // for more information of creating EndpointResource, please refer to the document of EndpointResource + string scope = "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default"; + string endpointName = "default"; + ResourceIdentifier endpointResourceId = EndpointResource.CreateResourceIdentifier(scope, endpointName); + EndpointResource endpointResource = client.GetEndpointResource(endpointResourceId); + + // get the collection of this ServiceConfigurationResource + ServiceConfigurationResourceCollection collection = endpointResource.GetServiceConfigurationResources(); + + // invoke the operation and iterate over the result + await foreach (ServiceConfigurationResource 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 + ServiceConfigurationResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HybridConnectivityEndpointsServiceconfigurationsGetSSH() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/ServiceConfigurationsGetSSH.json + // this example is just showing the usage of "ServiceConfigurations_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 EndpointResource created on azure + // for more information of creating EndpointResource, please refer to the document of EndpointResource + string scope = "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default"; + string endpointName = "default"; + ResourceIdentifier endpointResourceId = EndpointResource.CreateResourceIdentifier(scope, endpointName); + EndpointResource endpointResource = client.GetEndpointResource(endpointResourceId); + + // get the collection of this ServiceConfigurationResource + ServiceConfigurationResourceCollection collection = endpointResource.GetServiceConfigurationResources(); + + // invoke the operation + string serviceConfigurationName = "SSH"; + ServiceConfigurationResource result = await collection.GetAsync(serviceConfigurationName); + + // 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 + ServiceConfigurationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_HybridConnectivityEndpointsServiceconfigurationsGetSSH() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/ServiceConfigurationsGetSSH.json + // this example is just showing the usage of "ServiceConfigurations_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 EndpointResource created on azure + // for more information of creating EndpointResource, please refer to the document of EndpointResource + string scope = "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default"; + string endpointName = "default"; + ResourceIdentifier endpointResourceId = EndpointResource.CreateResourceIdentifier(scope, endpointName); + EndpointResource endpointResource = client.GetEndpointResource(endpointResourceId); + + // get the collection of this ServiceConfigurationResource + ServiceConfigurationResourceCollection collection = endpointResource.GetServiceConfigurationResources(); + + // invoke the operation + string serviceConfigurationName = "SSH"; + bool result = await collection.ExistsAsync(serviceConfigurationName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_HybridConnectivityEndpointsServiceconfigurationsGetSSH() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/ServiceConfigurationsGetSSH.json + // this example is just showing the usage of "ServiceConfigurations_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 EndpointResource created on azure + // for more information of creating EndpointResource, please refer to the document of EndpointResource + string scope = "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default"; + string endpointName = "default"; + ResourceIdentifier endpointResourceId = EndpointResource.CreateResourceIdentifier(scope, endpointName); + EndpointResource endpointResource = client.GetEndpointResource(endpointResourceId); + + // get the collection of this ServiceConfigurationResource + ServiceConfigurationResourceCollection collection = endpointResource.GetServiceConfigurationResources(); + + // invoke the operation + string serviceConfigurationName = "SSH"; + NullableResponse response = await collection.GetIfExistsAsync(serviceConfigurationName); + ServiceConfigurationResource 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 + ServiceConfigurationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HybridConnectivityEndpointsServiceconfigurationsGetWAC() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/ServiceConfigurationsGetWAC.json + // this example is just showing the usage of "ServiceConfigurations_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 EndpointResource created on azure + // for more information of creating EndpointResource, please refer to the document of EndpointResource + string scope = "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default"; + string endpointName = "default"; + ResourceIdentifier endpointResourceId = EndpointResource.CreateResourceIdentifier(scope, endpointName); + EndpointResource endpointResource = client.GetEndpointResource(endpointResourceId); + + // get the collection of this ServiceConfigurationResource + ServiceConfigurationResourceCollection collection = endpointResource.GetServiceConfigurationResources(); + + // invoke the operation + string serviceConfigurationName = "WAC"; + ServiceConfigurationResource result = await collection.GetAsync(serviceConfigurationName); + + // 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 + ServiceConfigurationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_HybridConnectivityEndpointsServiceconfigurationsGetWAC() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/ServiceConfigurationsGetWAC.json + // this example is just showing the usage of "ServiceConfigurations_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 EndpointResource created on azure + // for more information of creating EndpointResource, please refer to the document of EndpointResource + string scope = "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default"; + string endpointName = "default"; + ResourceIdentifier endpointResourceId = EndpointResource.CreateResourceIdentifier(scope, endpointName); + EndpointResource endpointResource = client.GetEndpointResource(endpointResourceId); + + // get the collection of this ServiceConfigurationResource + ServiceConfigurationResourceCollection collection = endpointResource.GetServiceConfigurationResources(); + + // invoke the operation + string serviceConfigurationName = "WAC"; + bool result = await collection.ExistsAsync(serviceConfigurationName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_HybridConnectivityEndpointsServiceconfigurationsGetWAC() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/ServiceConfigurationsGetWAC.json + // this example is just showing the usage of "ServiceConfigurations_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 EndpointResource created on azure + // for more information of creating EndpointResource, please refer to the document of EndpointResource + string scope = "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default"; + string endpointName = "default"; + ResourceIdentifier endpointResourceId = EndpointResource.CreateResourceIdentifier(scope, endpointName); + EndpointResource endpointResource = client.GetEndpointResource(endpointResourceId); + + // get the collection of this ServiceConfigurationResource + ServiceConfigurationResourceCollection collection = endpointResource.GetServiceConfigurationResources(); + + // invoke the operation + string serviceConfigurationName = "WAC"; + NullableResponse response = await collection.GetIfExistsAsync(serviceConfigurationName); + ServiceConfigurationResource 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 + ServiceConfigurationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ServiceConfigurationsPutSSH() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/ServiceConfigurationsPutSSH.json + // this example is just showing the usage of "ServiceConfigurations_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 EndpointResource created on azure + // for more information of creating EndpointResource, please refer to the document of EndpointResource + string scope = "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default"; + string endpointName = "default"; + ResourceIdentifier endpointResourceId = EndpointResource.CreateResourceIdentifier(scope, endpointName); + EndpointResource endpointResource = client.GetEndpointResource(endpointResourceId); + + // get the collection of this ServiceConfigurationResource + ServiceConfigurationResourceCollection collection = endpointResource.GetServiceConfigurationResources(); + + // invoke the operation + string serviceConfigurationName = "SSH"; + ServiceConfigurationResourceData data = new ServiceConfigurationResourceData() + { + ServiceName = HybridConnectivityServiceName.SSH, + Port = 22L, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceConfigurationName, data); + ServiceConfigurationResource 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 + ServiceConfigurationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ServiceConfigurationsPutWAC() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/examples/ServiceConfigurationsPutWAC.json + // this example is just showing the usage of "ServiceConfigurations_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 EndpointResource created on azure + // for more information of creating EndpointResource, please refer to the document of EndpointResource + string scope = "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default"; + string endpointName = "default"; + ResourceIdentifier endpointResourceId = EndpointResource.CreateResourceIdentifier(scope, endpointName); + EndpointResource endpointResource = client.GetEndpointResource(endpointResourceId); + + // get the collection of this ServiceConfigurationResource + ServiceConfigurationResourceCollection collection = endpointResource.GetServiceConfigurationResources(); + + // invoke the operation + string serviceConfigurationName = "WAC"; + ServiceConfigurationResourceData data = new ServiceConfigurationResourceData() + { + ServiceName = HybridConnectivityServiceName.WAC, + Port = 6516L, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceConfigurationName, data); + ServiceConfigurationResource 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 + ServiceConfigurationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_SolutionConfigurationCollection.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_SolutionConfigurationCollection.cs new file mode 100644 index 0000000000000..bbec2dadc3d13 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_SolutionConfigurationCollection.cs @@ -0,0 +1,190 @@ +// 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.HybridConnectivity.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.HybridConnectivity.Samples +{ + public partial class Sample_SolutionConfigurationCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_SolutionConfigurationsList() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/SolutionConfigurations_List.json + // this example is just showing the usage of "SolutionConfigurations_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 SolutionConfigurationResource + string resourceUri = "ymuj"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + SolutionConfigurationCollection collection = client.GetSolutionConfigurations(scopeId); + + // invoke the operation and iterate over the result + await foreach (SolutionConfigurationResource 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 + SolutionConfigurationData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SolutionConfigurationsGet() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/SolutionConfigurations_Get.json + // this example is just showing the usage of "SolutionConfigurations_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 SolutionConfigurationResource + string resourceUri = "ymuj"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + SolutionConfigurationCollection collection = client.GetSolutionConfigurations(scopeId); + + // invoke the operation + string solutionConfiguration = "tks"; + SolutionConfigurationResource result = await collection.GetAsync(solutionConfiguration); + + // 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 + SolutionConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_SolutionConfigurationsGet() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/SolutionConfigurations_Get.json + // this example is just showing the usage of "SolutionConfigurations_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 SolutionConfigurationResource + string resourceUri = "ymuj"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + SolutionConfigurationCollection collection = client.GetSolutionConfigurations(scopeId); + + // invoke the operation + string solutionConfiguration = "tks"; + bool result = await collection.ExistsAsync(solutionConfiguration); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SolutionConfigurationsGet() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/SolutionConfigurations_Get.json + // this example is just showing the usage of "SolutionConfigurations_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 SolutionConfigurationResource + string resourceUri = "ymuj"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + SolutionConfigurationCollection collection = client.GetSolutionConfigurations(scopeId); + + // invoke the operation + string solutionConfiguration = "tks"; + NullableResponse response = await collection.GetIfExistsAsync(solutionConfiguration); + SolutionConfigurationResource 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 + SolutionConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_SolutionConfigurationsCreateOrUpdate() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/SolutionConfigurations_CreateOrUpdate.json + // this example is just showing the usage of "SolutionConfigurations_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 SolutionConfigurationResource + string resourceUri = "ymuj"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + SolutionConfigurationCollection collection = client.GetSolutionConfigurations(scopeId); + + // invoke the operation + string solutionConfiguration = "keebwujt"; + SolutionConfigurationData data = new SolutionConfigurationData() + { + Properties = new SolutionConfigurationProperties("nmtqllkyohwtsthxaimsye") + { + SolutionSettings = +{ +}, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, solutionConfiguration, data); + SolutionConfigurationResource 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 + SolutionConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_SolutionConfigurationResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_SolutionConfigurationResource.cs new file mode 100644 index 0000000000000..76d9eaa5eb6e7 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_SolutionConfigurationResource.cs @@ -0,0 +1,138 @@ +// 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.HybridConnectivity.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.HybridConnectivity.Samples +{ + public partial class Sample_SolutionConfigurationResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SolutionConfigurationsGet() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/SolutionConfigurations_Get.json + // this example is just showing the usage of "SolutionConfigurations_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 SolutionConfigurationResource created on azure + // for more information of creating SolutionConfigurationResource, please refer to the document of SolutionConfigurationResource + string resourceUri = "ymuj"; + string solutionConfiguration = "tks"; + ResourceIdentifier solutionConfigurationResourceId = SolutionConfigurationResource.CreateResourceIdentifier(resourceUri, solutionConfiguration); + SolutionConfigurationResource solutionConfiguration0 = client.GetSolutionConfigurationResource(solutionConfigurationResourceId); + + // invoke the operation + SolutionConfigurationResource result = await solutionConfiguration0.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 + SolutionConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SolutionConfigurationsUpdate() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/SolutionConfigurations_Update.json + // this example is just showing the usage of "SolutionConfigurations_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 SolutionConfigurationResource created on azure + // for more information of creating SolutionConfigurationResource, please refer to the document of SolutionConfigurationResource + string resourceUri = "ymuj"; + string solutionConfiguration = "dxt"; + ResourceIdentifier solutionConfigurationResourceId = SolutionConfigurationResource.CreateResourceIdentifier(resourceUri, solutionConfiguration); + SolutionConfigurationResource solutionConfiguration0 = client.GetSolutionConfigurationResource(solutionConfigurationResourceId); + + // invoke the operation + SolutionConfigurationPatch patch = new SolutionConfigurationPatch() + { + Properties = new SolutionConfigurationPropertiesUpdate() + { + SolutionType = "myzljlstvmgkp", + SolutionSettings = +{ +}, + }, + }; + SolutionConfigurationResource result = await solutionConfiguration0.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SolutionConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_SolutionConfigurationsDelete() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/SolutionConfigurations_Delete.json + // this example is just showing the usage of "SolutionConfigurations_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 SolutionConfigurationResource created on azure + // for more information of creating SolutionConfigurationResource, please refer to the document of SolutionConfigurationResource + string resourceUri = "ymuj"; + string solutionConfiguration = "stu"; + ResourceIdentifier solutionConfigurationResourceId = SolutionConfigurationResource.CreateResourceIdentifier(resourceUri, solutionConfiguration); + SolutionConfigurationResource solutionConfiguration0 = client.GetSolutionConfigurationResource(solutionConfigurationResourceId); + + // invoke the operation + await solutionConfiguration0.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task SyncNow_SolutionConfigurationsSyncNow() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/SolutionConfigurations_SyncNow.json + // this example is just showing the usage of "SolutionConfigurations_SyncNow" 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 SolutionConfigurationResource created on azure + // for more information of creating SolutionConfigurationResource, please refer to the document of SolutionConfigurationResource + string resourceUri = "ymuj"; + string solutionConfiguration = "tks"; + ResourceIdentifier solutionConfigurationResourceId = SolutionConfigurationResource.CreateResourceIdentifier(resourceUri, solutionConfiguration); + SolutionConfigurationResource solutionConfiguration0 = client.GetSolutionConfigurationResource(solutionConfigurationResourceId); + + // invoke the operation + ArmOperation lro = await solutionConfiguration0.SyncNowAsync(WaitUntil.Completed); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_SolutionTypeResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_SolutionTypeResource.cs new file mode 100644 index 0000000000000..66e204ebfaf00 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_SolutionTypeResource.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.HybridConnectivity.Samples +{ + public partial class Sample_SolutionTypeResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSolutionTypeResources_SolutionTypesListBySubscription() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/SolutionTypes_ListBySubscription.json + // this example is just showing the usage of "SolutionTypes_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (SolutionTypeResource item in subscriptionResource.GetSolutionTypeResourcesAsync()) + { + // 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 + SolutionTypeResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SolutionTypesGet() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/SolutionTypes_Get.json + // this example is just showing the usage of "SolutionTypes_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 SolutionTypeResource created on azure + // for more information of creating SolutionTypeResource, please refer to the document of SolutionTypeResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + string resourceGroupName = "rgpublicCloud"; + string solutionType = "lulzqllpu"; + ResourceIdentifier solutionTypeResourceId = SolutionTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, solutionType); + SolutionTypeResource solutionTypeResource = client.GetSolutionTypeResource(solutionTypeResourceId); + + // invoke the operation + SolutionTypeResource result = await solutionTypeResource.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 + SolutionTypeResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_SolutionTypeResourceCollection.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_SolutionTypeResourceCollection.cs new file mode 100644 index 0000000000000..51116b68f9d0e --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_SolutionTypeResourceCollection.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.HybridConnectivity.Samples +{ + public partial class Sample_SolutionTypeResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_SolutionTypesListByResourceGroup() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/SolutionTypes_ListByResourceGroup.json + // this example is just showing the usage of "SolutionTypes_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + string resourceGroupName = "rgpublicCloud"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SolutionTypeResource + SolutionTypeResourceCollection collection = resourceGroupResource.GetSolutionTypeResources(); + + // invoke the operation and iterate over the result + await foreach (SolutionTypeResource 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 + SolutionTypeResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SolutionTypesGet() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/SolutionTypes_Get.json + // this example is just showing the usage of "SolutionTypes_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + string resourceGroupName = "rgpublicCloud"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SolutionTypeResource + SolutionTypeResourceCollection collection = resourceGroupResource.GetSolutionTypeResources(); + + // invoke the operation + string solutionType = "lulzqllpu"; + SolutionTypeResource result = await collection.GetAsync(solutionType); + + // 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 + SolutionTypeResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_SolutionTypesGet() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/SolutionTypes_Get.json + // this example is just showing the usage of "SolutionTypes_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + string resourceGroupName = "rgpublicCloud"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SolutionTypeResource + SolutionTypeResourceCollection collection = resourceGroupResource.GetSolutionTypeResources(); + + // invoke the operation + string solutionType = "lulzqllpu"; + bool result = await collection.ExistsAsync(solutionType); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SolutionTypesGet() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/SolutionTypes_Get.json + // this example is just showing the usage of "SolutionTypes_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + string resourceGroupName = "rgpublicCloud"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SolutionTypeResource + SolutionTypeResourceCollection collection = resourceGroupResource.GetSolutionTypeResources(); + + // invoke the operation + string solutionType = "lulzqllpu"; + NullableResponse response = await collection.GetIfExistsAsync(solutionType); + SolutionTypeResource 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 + SolutionTypeResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 0000000000000..0b6d561e9e2bc --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,56 @@ +// 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.HybridConnectivity.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.HybridConnectivity.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task PostGenerateAwsTemplate_GenerateAwsTemplatePost() + { + // Generated from example definition: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/PublicCloud/stable/2024-12-01/examples/GenerateAwsTemplate_Post.json + // this example is just showing the usage of "GenerateAwsTemplate_Post" 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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "5ACC4579-DB34-4C2F-8F8C-25061168F342"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + GenerateAwsTemplateContent content = new GenerateAwsTemplateContent(new ResourceIdentifier("pnxcfjidglabnwxit")) + { + SolutionTypes = +{ +new SolutionTypeSettings("hjyownzpfxwiufmd") +{ +SolutionSettings = +{ +}, +} +}, + }; + BinaryData result = await subscriptionResource.PostGenerateAwsTemplateAsync(content); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ArmHybridConnectivityModelFactory.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ArmHybridConnectivityModelFactory.cs index 4efeec6fe0149..2b0e016093f10 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ArmHybridConnectivityModelFactory.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ArmHybridConnectivityModelFactory.cs @@ -6,6 +6,8 @@ #nullable disable using System; +using System.Collections.Generic; +using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -14,37 +16,277 @@ namespace Azure.ResourceManager.HybridConnectivity.Models /// Model factory for models. public static partial class ArmHybridConnectivityModelFactory { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static SolutionConfigurationData SolutionConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, SolutionConfigurationProperties properties = null) + { + return new SolutionConfigurationData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The resource provisioning state. + /// The type of the solution. + /// Solution settings. + /// The status of solution configurations. + /// The detailed message of status details. + /// The last time resources were inventoried. + /// A new instance for mocking. + public static SolutionConfigurationProperties SolutionConfigurationProperties(HybridConnectivityResourceProvisioningState? provisioningState = null, string solutionType = null, IDictionary solutionSettings = null, SolutionConfigurationStatus? status = null, string statusDetails = null, DateTimeOffset? lastSyncOn = null) + { + solutionSettings ??= new Dictionary(); + + return new SolutionConfigurationProperties( + provisioningState, + solutionType, + solutionSettings, + status, + statusDetails, + lastSyncOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static SolutionConfigurationPatch SolutionConfigurationPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, SolutionConfigurationPropertiesUpdate properties = null) + { + return new SolutionConfigurationPatch( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static HybridConnectivityInventoryResourceData HybridConnectivityInventoryResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, HybridConnectivityInventoryProperties properties = null) + { + return new HybridConnectivityInventoryResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the cloud native resource type. + /// Gets or sets the cloud native resource name. + /// Gets or sets the mapped azure resource id. + /// Gets or sets the status of the inventory. + /// Gets or sets the status details. + /// The resource provisioning state. + /// A new instance for mocking. + public static HybridConnectivityInventoryProperties HybridConnectivityInventoryProperties(HybridConnectivityCloudNativeType? cloudNativeType = null, string cloudNativeResourceId = null, ResourceIdentifier azureResourceId = null, SolutionConfigurationStatus? status = null, string statusDetails = null, HybridConnectivityResourceProvisioningState? provisioningState = null) + { + return new HybridConnectivityInventoryProperties( + cloudNativeType, + cloudNativeResourceId, + azureResourceId, + status, + statusDetails, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Fully qualified ID for the async operation. + /// Fully qualified ID of the resource against which the original async operation was started. + /// Name of the async operation. + /// Operation status. + /// Percent of the operation that is complete. + /// The start time of the operation. + /// The end time of the operation. + /// The operations list. + /// If present, details of the operation error. + /// A new instance for mocking. + public static OperationStatusResult OperationStatusResult(ResourceIdentifier id = null, ResourceIdentifier resourceId = null, string name = null, string status = null, float? percentComplete = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, IEnumerable operations = null, ResponseError error = null) + { + operations ??= new List(); + + return new OperationStatusResult( + id, + resourceId, + name, + status, + percentComplete, + startOn, + endOn, + operations?.ToList(), + error, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of public cloud connector. + /// The list of solution types and their settings. + /// A new instance for mocking. + public static GenerateAwsTemplateContent GenerateAwsTemplateContent(ResourceIdentifier connectorId = null, IEnumerable solutionTypes = null) + { + solutionTypes ??= new List(); + + return new GenerateAwsTemplateContent(connectorId, solutionTypes?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The type of the solution. + /// Solution settings. + /// A new instance for mocking. + public static SolutionTypeSettings SolutionTypeSettings(string solutionType = null, IDictionary solutionSettings = null) + { + solutionSettings ??= new Dictionary(); + + return new SolutionTypeSettings(solutionType, solutionSettings, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static PublicCloudConnectorData PublicCloudConnectorData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, PublicCloudConnectorProperties properties = null) + { + tags ??= new Dictionary(); + + return new PublicCloudConnectorData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Cloud profile for AWS. + /// Host cloud the public cloud connector. + /// The resource provisioning state. + /// Connector primary identifier. + /// A new instance for mocking. + public static PublicCloudConnectorProperties PublicCloudConnectorProperties(AwsCloudProfile awsCloudProfile = null, HybridConnectivityHostType hostType = default, HybridConnectivityResourceProvisioningState? provisioningState = null, Guid? connectorPrimaryIdentifier = null) + { + return new PublicCloudConnectorProperties(awsCloudProfile, hostType, provisioningState, connectorPrimaryIdentifier, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static SolutionTypeResourceData SolutionTypeResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, SolutionTypeProperties properties = null) + { + return new SolutionTypeResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Resource tags. + /// A new instance for mocking. + public static PublicCloudConnectorPatch PublicCloudConnectorPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable awsCloudExcludedAccounts = null, IDictionary tags = null) + { + awsCloudExcludedAccounts ??= new List(); + tags ??= new Dictionary(); + + return new PublicCloudConnectorPatch( + id, + name, + resourceType, + systemData, + awsCloudExcludedAccounts != null ? new PublicCloudConnectorPropertiesUpdate(new AwsCloudProfileUpdate(awsCloudExcludedAccounts?.ToList(), serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, + tags, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The type of endpoint. - /// The resource Id of the connectivity endpoint (optional). - /// - /// The identity that created the resource. - /// The type of identity that created the resource. - /// The timestamp of resource creation (UTC). - /// The identity that last modified the resource. - /// The type of identity that last modified the resource. - /// The timestamp of resource last modification (UTC). + /// The endpoint properties. /// A new instance for mocking. - public static EndpointResourceData EndpointResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, EndpointType? endpointType = null, string resourceId = null, string provisioningState = null, string createdBy = null, CreatedByType? createdByType = null, DateTimeOffset? createdOn = null, string lastModifiedBy = null, CreatedByType? lastModifiedByType = null, DateTimeOffset? lastModifiedOn = null) + public static EndpointResourceData EndpointResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, HybridConnectivityEndpointProperties properties = null) { return new EndpointResourceData( id, name, resourceType, systemData, - endpointType, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The type of endpoint. + /// The resource Id of the connectivity endpoint (optional). + /// The resource provisioning state. + /// A new instance for mocking. + public static HybridConnectivityEndpointProperties HybridConnectivityEndpointProperties(EndpointType endpointType = default, ResourceIdentifier resourceId = null, string provisioningState = null) + { + return new HybridConnectivityEndpointProperties(endpointType, resourceId, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Name of the service. + /// The resource Id of the connectivity endpoint (optional). + /// The port on which service is enabled. + /// The resource provisioning state. + /// A new instance for mocking. + public static ServiceConfigurationResourceData ServiceConfigurationResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, HybridConnectivityServiceName? serviceName = null, ResourceIdentifier resourceId = null, long? port = null, HybridConnectivityProvisioningState? provisioningState = null) + { + return new ServiceConfigurationResourceData( + id, + name, + resourceType, + systemData, + serviceName, resourceId, + port, provisioningState, - createdBy, - createdByType, - createdOn, - lastModifiedBy, - lastModifiedByType, - lastModifiedOn, serializedAdditionalRawData: null); } @@ -54,8 +296,9 @@ public static EndpointResourceData EndpointResourceData(ResourceIdentifier id = /// Azure Relay hybrid connection name for the resource. /// Access key for hybrid connection. /// The expiration of access key in unix time. + /// The token to access the enabled service. /// A new instance for mocking. - public static TargetResourceEndpointAccess TargetResourceEndpointAccess(string namespaceName = null, string namespaceNameSuffix = null, string hybridConnectionName = null, string accessKey = null, long? expiresOn = null) + public static TargetResourceEndpointAccess TargetResourceEndpointAccess(string namespaceName = null, string namespaceNameSuffix = null, string hybridConnectionName = null, string accessKey = null, long? expiresOn = null, string serviceConfigurationToken = null) { return new TargetResourceEndpointAccess( namespaceName, @@ -63,7 +306,53 @@ public static TargetResourceEndpointAccess TargetResourceEndpointAccess(string n hybridConnectionName, accessKey, expiresOn, + serviceConfigurationToken, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The ingress hostname. + /// The arc ingress gateway server app id. + /// The target resource home tenant id. + /// The namespace name. + /// The suffix domain name of relay namespace. + /// Azure Relay hybrid connection name for the resource. + /// Access key for hybrid connection. + /// The expiration of access key in unix time. + /// The token to access the enabled service. + /// A new instance for mocking. + public static IngressGatewayAsset IngressGatewayAsset(string hostname = null, ResourceIdentifier serverId = null, Guid? tenantId = null, string namespaceName = null, string namespaceNameSuffix = null, string hybridConnectionName = null, string accessKey = null, long? expiresOn = null, string serviceConfigurationToken = null) + { + return new IngressGatewayAsset( + hostname, + serverId, + tenantId, + namespaceName, + namespaceNameSuffix, + hybridConnectionName, + accessKey, + expiresOn, + serviceConfigurationToken, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The name of the service. + /// The target host name. + /// The name of the service. It is an optional property, if not provided, service configuration tokens issue code would be by passed. + /// A new instance for mocking. + public static ManagedProxyContent ManagedProxyContent(string service = null, string hostname = null, HybridConnectivityServiceName? serviceName = null) + { + return new ManagedProxyContent(service, hostname, serviceName, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The short lived proxy name. + /// The expiration time of short lived proxy name in unix epoch. + /// A new instance for mocking. + public static ManagedProxyAsset ManagedProxyAsset(string proxy = null, long expiresOn = default) + { + return new ManagedProxyAsset(proxy, expiresOn, serializedAdditionalRawData: null); + } } } diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResource.cs index dcddee76d2a55..63d3759860ada 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResource.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResource.cs @@ -87,6 +87,73 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets a collection of ServiceConfigurationResources in the EndpointResource. + /// An object representing collection of ServiceConfigurationResources and their operations over a ServiceConfigurationResource. + public virtual ServiceConfigurationResourceCollection GetServiceConfigurationResources() + { + return GetCachedClient(client => new ServiceConfigurationResourceCollection(client, Id)); + } + + /// + /// Gets the details about the service to the resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName} + /// + /// + /// Operation Id + /// ServiceConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The service name. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetServiceConfigurationResourceAsync(string serviceConfigurationName, CancellationToken cancellationToken = default) + { + return await GetServiceConfigurationResources().GetAsync(serviceConfigurationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details about the service to the resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName} + /// + /// + /// Operation Id + /// ServiceConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The service name. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual Response GetServiceConfigurationResource(string serviceConfigurationName, CancellationToken cancellationToken = default) + { + return GetServiceConfigurationResources().Get(serviceConfigurationName, cancellationToken); + } + /// /// Gets the endpoint to the resource. /// @@ -100,7 +167,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -140,7 +207,7 @@ public virtual async Task> GetAsync(CancellationToken /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -180,7 +247,7 @@ public virtual Response Get(CancellationToken cancellationToke /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -224,7 +291,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -268,7 +335,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -310,7 +377,7 @@ public virtual async Task> UpdateAsync(EndpointResour /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -352,7 +419,7 @@ public virtual Response Update(EndpointResourceData data, Canc /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -360,15 +427,16 @@ public virtual Response Update(EndpointResourceData data, Canc /// /// /// + /// Object of type ListCredentialsRequest. /// The is how long the endpoint access token is valid (in seconds). /// The cancellation token to use. - public virtual async Task> GetCredentialsAsync(long? expiresin = null, CancellationToken cancellationToken = default) + public virtual async Task> GetCredentialsAsync(ListCredentialsContent content = null, long? expiresin = null, CancellationToken cancellationToken = default) { using var scope = _endpointResourceEndpointsClientDiagnostics.CreateScope("EndpointResource.GetCredentials"); scope.Start(); try { - var response = await _endpointResourceEndpointsRestClient.ListCredentialsAsync(Id.Parent, Id.Name, expiresin, cancellationToken).ConfigureAwait(false); + var response = await _endpointResourceEndpointsRestClient.ListCredentialsAsync(Id.Parent, Id.Name, content, expiresin, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -391,7 +459,7 @@ public virtual async Task> GetCredentials /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -399,15 +467,180 @@ public virtual async Task> GetCredentials /// /// /// + /// Object of type ListCredentialsRequest. /// The is how long the endpoint access token is valid (in seconds). /// The cancellation token to use. - public virtual Response GetCredentials(long? expiresin = null, CancellationToken cancellationToken = default) + public virtual Response GetCredentials(ListCredentialsContent content = null, long? expiresin = null, CancellationToken cancellationToken = default) { using var scope = _endpointResourceEndpointsClientDiagnostics.CreateScope("EndpointResource.GetCredentials"); scope.Start(); try { - var response = _endpointResourceEndpointsRestClient.ListCredentials(Id.Parent, Id.Name, expiresin, cancellationToken); + var response = _endpointResourceEndpointsRestClient.ListCredentials(Id.Parent, Id.Name, content, expiresin, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the ingress gateway endpoint credentials + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/listIngressGatewayCredentials + /// + /// + /// Operation Id + /// Endpoints_ListIngressGatewayCredentials + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Object of type ListIngressGatewayCredentialsRequest. + /// The is how long the endpoint access token is valid (in seconds). + /// The cancellation token to use. + public virtual async Task> GetIngressGatewayCredentialsAsync(ListIngressGatewayCredentialsContent content = null, long? expiresin = null, CancellationToken cancellationToken = default) + { + using var scope = _endpointResourceEndpointsClientDiagnostics.CreateScope("EndpointResource.GetIngressGatewayCredentials"); + scope.Start(); + try + { + var response = await _endpointResourceEndpointsRestClient.ListIngressGatewayCredentialsAsync(Id.Parent, Id.Name, content, expiresin, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the ingress gateway endpoint credentials + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/listIngressGatewayCredentials + /// + /// + /// Operation Id + /// Endpoints_ListIngressGatewayCredentials + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Object of type ListIngressGatewayCredentialsRequest. + /// The is how long the endpoint access token is valid (in seconds). + /// The cancellation token to use. + public virtual Response GetIngressGatewayCredentials(ListIngressGatewayCredentialsContent content = null, long? expiresin = null, CancellationToken cancellationToken = default) + { + using var scope = _endpointResourceEndpointsClientDiagnostics.CreateScope("EndpointResource.GetIngressGatewayCredentials"); + scope.Start(); + try + { + var response = _endpointResourceEndpointsRestClient.ListIngressGatewayCredentials(Id.Parent, Id.Name, content, expiresin, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Fetches the managed proxy details + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/listManagedProxyDetails + /// + /// + /// Operation Id + /// Endpoints_ListManagedProxyDetails + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Object of type ManagedProxyRequest. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetManagedProxyDetailsAsync(ManagedProxyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _endpointResourceEndpointsClientDiagnostics.CreateScope("EndpointResource.GetManagedProxyDetails"); + scope.Start(); + try + { + var response = await _endpointResourceEndpointsRestClient.ListManagedProxyDetailsAsync(Id.Parent, Id.Name, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Fetches the managed proxy details + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/listManagedProxyDetails + /// + /// + /// Operation Id + /// Endpoints_ListManagedProxyDetails + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Object of type ManagedProxyRequest. + /// The cancellation token to use. + /// is null. + public virtual Response GetManagedProxyDetails(ManagedProxyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _endpointResourceEndpointsClientDiagnostics.CreateScope("EndpointResource.GetManagedProxyDetails"); + scope.Start(); + try + { + var response = _endpointResourceEndpointsRestClient.ListManagedProxyDetails(Id.Parent, Id.Name, content, cancellationToken); return response; } catch (Exception e) diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResourceCollection.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResourceCollection.cs index fd1c959df501a..79704cdaa998e 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResourceCollection.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResourceCollection.cs @@ -54,7 +54,7 @@ internal EndpointResourceCollection(ArmClient client, ResourceIdentifier id) : b /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -104,7 +104,7 @@ public virtual async Task> CreateOrUpdateAsync(Wa /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -198,7 +198,7 @@ public virtual async Task> GetAsync(string endpointNa /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -242,7 +242,7 @@ public virtual Response Get(string endpointName, CancellationT /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -272,7 +272,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken can /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -302,7 +302,7 @@ public virtual Pageable GetAll(CancellationToken cancellationT /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -344,7 +344,7 @@ public virtual async Task> ExistsAsync(string endpointName, Cance /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -386,7 +386,7 @@ public virtual Response Exists(string endpointName, CancellationToken canc /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -430,7 +430,7 @@ public virtual async Task> GetIfExistsAsync(s /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResourceData.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResourceData.Serialization.cs index af2fd590e57e1..e5548e146f342 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResourceData.Serialization.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResourceData.Serialization.cs @@ -37,57 +37,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(EndpointType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(EndpointType.Value.ToString()); - } - if (Optional.IsDefined(ResourceId)) - { - writer.WritePropertyName("resourceId"u8); - writer.WriteStringValue(ResourceId); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState); - } - writer.WriteEndObject(); - writer.WritePropertyName("systemData"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(CreatedBy)) - { - writer.WritePropertyName("createdBy"u8); - writer.WriteStringValue(CreatedBy); - } - if (Optional.IsDefined(CreatedByType)) - { - writer.WritePropertyName("createdByType"u8); - writer.WriteStringValue(CreatedByType.Value.ToString()); - } - if (Optional.IsDefined(CreatedOn)) - { - writer.WritePropertyName("createdAt"u8); - writer.WriteStringValue(CreatedOn.Value, "O"); - } - if (Optional.IsDefined(LastModifiedBy)) - { - writer.WritePropertyName("lastModifiedBy"u8); - writer.WriteStringValue(LastModifiedBy); - } - if (Optional.IsDefined(LastModifiedByType)) - { - writer.WritePropertyName("lastModifiedByType"u8); - writer.WriteStringValue(LastModifiedByType.Value.ToString()); - } - if (Optional.IsDefined(LastModifiedOn)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("lastModifiedAt"u8); - writer.WriteStringValue(LastModifiedOn.Value, "O"); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - writer.WriteEndObject(); } EndpointResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -110,23 +64,24 @@ internal static EndpointResourceData DeserializeEndpointResourceData(JsonElement { return null; } + HybridConnectivityEndpointProperties properties = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - EndpointType? type0 = default; - string resourceId = default; - string provisioningState = default; - string createdBy = default; - Models.CreatedByType? createdByType = default; - DateTimeOffset? createdAt = default; - string lastModifiedBy = default; - Models.CreatedByType? lastModifiedByType = default; - DateTimeOffset? lastModifiedAt = 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) + { + continue; + } + properties = HybridConnectivityEndpointProperties.DeserializeHybridConnectivityEndpointProperties(property.Value, options); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -151,95 +106,6 @@ internal static EndpointResourceData DeserializeEndpointResourceData(JsonElement systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("type"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - type0 = new EndpointType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("resourceId"u8)) - { - resourceId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - provisioningState = property0.Value.GetString(); - continue; - } - } - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("createdBy"u8)) - { - createdBy = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("createdByType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - createdByType = new Models.CreatedByType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("createdAt"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - createdAt = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("lastModifiedBy"u8)) - { - lastModifiedBy = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("lastModifiedByType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - lastModifiedByType = new Models.CreatedByType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("lastModifiedAt"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - lastModifiedAt = property0.Value.GetDateTimeOffset("O"); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -251,15 +117,7 @@ internal static EndpointResourceData DeserializeEndpointResourceData(JsonElement name, type, systemData, - type0, - resourceId, - provisioningState, - createdBy, - createdByType, - createdAt, - lastModifiedBy, - lastModifiedByType, - lastModifiedAt, + properties, serializedAdditionalRawData); } diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResourceData.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResourceData.cs index b12d5e6c935b8..6ceb2070954dd 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResourceData.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResourceData.cs @@ -61,47 +61,15 @@ public EndpointResourceData() /// The name. /// The resourceType. /// The systemData. - /// The type of endpoint. - /// The resource Id of the connectivity endpoint (optional). - /// - /// The identity that created the resource. - /// The type of identity that created the resource. - /// The timestamp of resource creation (UTC). - /// The identity that last modified the resource. - /// The type of identity that last modified the resource. - /// The timestamp of resource last modification (UTC). + /// The endpoint properties. /// Keeps track of any properties unknown to the library. - internal EndpointResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, EndpointType? endpointType, string resourceId, string provisioningState, string createdBy, Models.CreatedByType? createdByType, DateTimeOffset? createdOn, string lastModifiedBy, Models.CreatedByType? lastModifiedByType, DateTimeOffset? lastModifiedOn, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal EndpointResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, HybridConnectivityEndpointProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - EndpointType = endpointType; - ResourceId = resourceId; - ProvisioningState = provisioningState; - CreatedBy = createdBy; - CreatedByType = createdByType; - CreatedOn = createdOn; - LastModifiedBy = lastModifiedBy; - LastModifiedByType = lastModifiedByType; - LastModifiedOn = lastModifiedOn; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The type of endpoint. - public EndpointType? EndpointType { get; set; } - /// The resource Id of the connectivity endpoint (optional). - public string ResourceId { get; set; } - /// Gets the provisioning state. - public string ProvisioningState { get; } - /// The identity that created the resource. - public string CreatedBy { get; set; } - /// The type of identity that created the resource. - public Models.CreatedByType? CreatedByType { get; set; } - /// The timestamp of resource creation (UTC). - public DateTimeOffset? CreatedOn { get; set; } - /// The identity that last modified the resource. - public string LastModifiedBy { get; set; } - /// The type of identity that last modified the resource. - public Models.CreatedByType? LastModifiedByType { get; set; } - /// The timestamp of resource last modification (UTC). - public DateTimeOffset? LastModifiedOn { get; set; } + /// The endpoint properties. + public HybridConnectivityEndpointProperties Properties { get; set; } } } diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/HybridConnectivityExtensions.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/HybridConnectivityExtensions.cs index 693c2da650d16..9c931357f0824 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/HybridConnectivityExtensions.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/HybridConnectivityExtensions.cs @@ -10,6 +10,8 @@ using System.Threading.Tasks; using Azure.Core; using Azure.ResourceManager.HybridConnectivity.Mocking; +using Azure.ResourceManager.HybridConnectivity.Models; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.HybridConnectivity { @@ -21,6 +23,112 @@ private static MockableHybridConnectivityArmClient GetMockableHybridConnectivity return client.GetCachedClient(client0 => new MockableHybridConnectivityArmClient(client0)); } + private static MockableHybridConnectivityResourceGroupResource GetMockableHybridConnectivityResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableHybridConnectivityResourceGroupResource(client, resource.Id)); + } + + private static MockableHybridConnectivitySubscriptionResource GetMockableHybridConnectivitySubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableHybridConnectivitySubscriptionResource(client, resource.Id)); + } + + /// + /// Gets a collection of SolutionConfigurationResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// is null. + /// An object representing collection of SolutionConfigurationResources and their operations over a SolutionConfigurationResource. + public static SolutionConfigurationCollection GetSolutionConfigurations(this ArmClient client, ResourceIdentifier scope) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableHybridConnectivityArmClient(client).GetSolutionConfigurations(scope); + } + + /// + /// Get a SolutionConfiguration + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// Represent Solution Configuration 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> GetSolutionConfigurationAsync(this ArmClient client, ResourceIdentifier scope, string solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(client, nameof(client)); + + return await GetMockableHybridConnectivityArmClient(client).GetSolutionConfigurationAsync(scope, solutionConfiguration, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a SolutionConfiguration + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// Represent Solution Configuration Resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetSolutionConfiguration(this ArmClient client, ResourceIdentifier scope, string solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableHybridConnectivityArmClient(client).GetSolutionConfiguration(scope, solutionConfiguration, cancellationToken); + } + /// /// Gets a collection of EndpointResources in the ArmClient. /// @@ -52,7 +160,7 @@ public static EndpointResourceCollection GetEndpointResources(this ArmClient cli /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -90,7 +198,7 @@ public static async Task> GetEndpointResourceAsync(th /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -115,6 +223,82 @@ public static Response GetEndpointResource(this ArmClient clie return GetMockableHybridConnectivityArmClient(client).GetEndpointResource(scope, endpointName, cancellationToken); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static SolutionConfigurationResource GetSolutionConfigurationResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableHybridConnectivityArmClient(client).GetSolutionConfigurationResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static HybridConnectivityInventoryResource GetHybridConnectivityInventoryResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableHybridConnectivityArmClient(client).GetHybridConnectivityInventoryResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static PublicCloudConnectorResource GetPublicCloudConnectorResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableHybridConnectivityArmClient(client).GetPublicCloudConnectorResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static SolutionTypeResource GetSolutionTypeResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableHybridConnectivityArmClient(client).GetSolutionTypeResource(id); + } + /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. @@ -133,5 +317,418 @@ public static EndpointResource GetEndpointResource(this ArmClient client, Resour return GetMockableHybridConnectivityArmClient(client).GetEndpointResource(id); } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ServiceConfigurationResource GetServiceConfigurationResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableHybridConnectivityArmClient(client).GetServiceConfigurationResource(id); + } + + /// + /// Gets a collection of PublicCloudConnectorResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of PublicCloudConnectorResources and their operations over a PublicCloudConnectorResource. + public static PublicCloudConnectorCollection GetPublicCloudConnectors(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableHybridConnectivityResourceGroupResource(resourceGroupResource).GetPublicCloudConnectors(); + } + + /// + /// Get a PublicCloudConnector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Represent public cloud connectors 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> GetPublicCloudConnectorAsync(this ResourceGroupResource resourceGroupResource, string publicCloudConnector, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableHybridConnectivityResourceGroupResource(resourceGroupResource).GetPublicCloudConnectorAsync(publicCloudConnector, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a PublicCloudConnector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Represent public cloud connectors resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetPublicCloudConnector(this ResourceGroupResource resourceGroupResource, string publicCloudConnector, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableHybridConnectivityResourceGroupResource(resourceGroupResource).GetPublicCloudConnector(publicCloudConnector, cancellationToken); + } + + /// + /// Gets a collection of SolutionTypeResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of SolutionTypeResources and their operations over a SolutionTypeResource. + public static SolutionTypeResourceCollection GetSolutionTypeResources(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableHybridConnectivityResourceGroupResource(resourceGroupResource).GetSolutionTypeResources(); + } + + /// + /// Get a SolutionTypeResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes/{solutionType} + /// + /// + /// Operation Id + /// SolutionTypes_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Solution Type 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> GetSolutionTypeResourceAsync(this ResourceGroupResource resourceGroupResource, string solutionType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableHybridConnectivityResourceGroupResource(resourceGroupResource).GetSolutionTypeResourceAsync(solutionType, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a SolutionTypeResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes/{solutionType} + /// + /// + /// Operation Id + /// SolutionTypes_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Solution Type resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetSolutionTypeResource(this ResourceGroupResource resourceGroupResource, string solutionType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableHybridConnectivityResourceGroupResource(resourceGroupResource).GetSolutionTypeResource(solutionType, cancellationToken); + } + + /// + /// Retrieve AWS Cloud Formation template + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/generateAwsTemplate + /// + /// + /// Operation Id + /// GenerateAwsTemplate_Post + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// ConnectorId and SolutionTypes and their properties to Generate AWS CFT Template. + /// The cancellation token to use. + /// or is null. + public static async Task> PostGenerateAwsTemplateAsync(this SubscriptionResource subscriptionResource, GenerateAwsTemplateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableHybridConnectivitySubscriptionResource(subscriptionResource).PostGenerateAwsTemplateAsync(content, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve AWS Cloud Formation template + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/generateAwsTemplate + /// + /// + /// Operation Id + /// GenerateAwsTemplate_Post + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// ConnectorId and SolutionTypes and their properties to Generate AWS CFT Template. + /// The cancellation token to use. + /// or is null. + public static Response PostGenerateAwsTemplate(this SubscriptionResource subscriptionResource, GenerateAwsTemplateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableHybridConnectivitySubscriptionResource(subscriptionResource).PostGenerateAwsTemplate(content, cancellationToken); + } + + /// + /// List PublicCloudConnector resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/publicCloudConnectors + /// + /// + /// Operation Id + /// PublicCloudConnectors_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetPublicCloudConnectorsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableHybridConnectivitySubscriptionResource(subscriptionResource).GetPublicCloudConnectorsAsync(cancellationToken); + } + + /// + /// List PublicCloudConnector resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/publicCloudConnectors + /// + /// + /// Operation Id + /// PublicCloudConnectors_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetPublicCloudConnectors(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableHybridConnectivitySubscriptionResource(subscriptionResource).GetPublicCloudConnectors(cancellationToken); + } + + /// + /// List SolutionTypeResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/solutionTypes + /// + /// + /// Operation Id + /// SolutionTypes_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetSolutionTypeResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableHybridConnectivitySubscriptionResource(subscriptionResource).GetSolutionTypeResourcesAsync(cancellationToken); + } + + /// + /// List SolutionTypeResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/solutionTypes + /// + /// + /// Operation Id + /// SolutionTypes_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetSolutionTypeResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableHybridConnectivitySubscriptionResource(subscriptionResource).GetSolutionTypeResources(cancellationToken); + } } } diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/MockableHybridConnectivityArmClient.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/MockableHybridConnectivityArmClient.cs index bda981c23a3bd..9f5987af8fffc 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/MockableHybridConnectivityArmClient.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/MockableHybridConnectivityArmClient.cs @@ -37,6 +37,78 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } + /// Gets a collection of SolutionConfigurationResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of SolutionConfigurationResources and their operations over a SolutionConfigurationResource. + public virtual SolutionConfigurationCollection GetSolutionConfigurations(ResourceIdentifier scope) + { + return new SolutionConfigurationCollection(Client, scope); + } + + /// + /// Get a SolutionConfiguration + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The scope that the resource will apply against. + /// Represent Solution Configuration Resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSolutionConfigurationAsync(ResourceIdentifier scope, string solutionConfiguration, CancellationToken cancellationToken = default) + { + return await GetSolutionConfigurations(scope).GetAsync(solutionConfiguration, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a SolutionConfiguration + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The scope that the resource will apply against. + /// Represent Solution Configuration Resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSolutionConfiguration(ResourceIdentifier scope, string solutionConfiguration, CancellationToken cancellationToken = default) + { + return GetSolutionConfigurations(scope).Get(solutionConfiguration, cancellationToken); + } + /// Gets a collection of EndpointResources in the ArmClient. /// The scope that the resource will apply against. /// An object representing collection of EndpointResources and their operations over a EndpointResource. @@ -58,7 +130,7 @@ public virtual EndpointResourceCollection GetEndpointResources(ResourceIdentifie /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -89,7 +161,7 @@ public virtual async Task> GetEndpointResourceAsync(R /// /// /// Default Api Version - /// 2021-10-06-preview + /// 2024-12-01 /// /// /// Resource @@ -107,6 +179,54 @@ public virtual Response GetEndpointResource(ResourceIdentifier return GetEndpointResources(scope).Get(endpointName, cancellationToken); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SolutionConfigurationResource GetSolutionConfigurationResource(ResourceIdentifier id) + { + SolutionConfigurationResource.ValidateResourceId(id); + return new SolutionConfigurationResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual HybridConnectivityInventoryResource GetHybridConnectivityInventoryResource(ResourceIdentifier id) + { + HybridConnectivityInventoryResource.ValidateResourceId(id); + return new HybridConnectivityInventoryResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual PublicCloudConnectorResource GetPublicCloudConnectorResource(ResourceIdentifier id) + { + PublicCloudConnectorResource.ValidateResourceId(id); + return new PublicCloudConnectorResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SolutionTypeResource GetSolutionTypeResource(ResourceIdentifier id) + { + SolutionTypeResource.ValidateResourceId(id); + return new SolutionTypeResource(Client, id); + } + /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. @@ -118,5 +238,17 @@ public virtual EndpointResource GetEndpointResource(ResourceIdentifier id) EndpointResource.ValidateResourceId(id); return new EndpointResource(Client, id); } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ServiceConfigurationResource GetServiceConfigurationResource(ResourceIdentifier id) + { + ServiceConfigurationResource.ValidateResourceId(id); + return new ServiceConfigurationResource(Client, id); + } } } diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/MockableHybridConnectivityResourceGroupResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/MockableHybridConnectivityResourceGroupResource.cs new file mode 100644 index 0000000000000..c3f25222a604f --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/MockableHybridConnectivityResourceGroupResource.cs @@ -0,0 +1,174 @@ +// 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.HybridConnectivity.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableHybridConnectivityResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableHybridConnectivityResourceGroupResource() + { + } + + /// 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 MockableHybridConnectivityResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of PublicCloudConnectorResources in the ResourceGroupResource. + /// An object representing collection of PublicCloudConnectorResources and their operations over a PublicCloudConnectorResource. + public virtual PublicCloudConnectorCollection GetPublicCloudConnectors() + { + return GetCachedClient(client => new PublicCloudConnectorCollection(client, Id)); + } + + /// + /// Get a PublicCloudConnector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Represent public cloud connectors resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPublicCloudConnectorAsync(string publicCloudConnector, CancellationToken cancellationToken = default) + { + return await GetPublicCloudConnectors().GetAsync(publicCloudConnector, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a PublicCloudConnector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Represent public cloud connectors resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPublicCloudConnector(string publicCloudConnector, CancellationToken cancellationToken = default) + { + return GetPublicCloudConnectors().Get(publicCloudConnector, cancellationToken); + } + + /// Gets a collection of SolutionTypeResources in the ResourceGroupResource. + /// An object representing collection of SolutionTypeResources and their operations over a SolutionTypeResource. + public virtual SolutionTypeResourceCollection GetSolutionTypeResources() + { + return GetCachedClient(client => new SolutionTypeResourceCollection(client, Id)); + } + + /// + /// Get a SolutionTypeResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes/{solutionType} + /// + /// + /// Operation Id + /// SolutionTypes_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Solution Type resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSolutionTypeResourceAsync(string solutionType, CancellationToken cancellationToken = default) + { + return await GetSolutionTypeResources().GetAsync(solutionType, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a SolutionTypeResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes/{solutionType} + /// + /// + /// Operation Id + /// SolutionTypes_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Solution Type resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSolutionTypeResource(string solutionType, CancellationToken cancellationToken = default) + { + return GetSolutionTypeResources().Get(solutionType, cancellationToken); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/MockableHybridConnectivitySubscriptionResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/MockableHybridConnectivitySubscriptionResource.cs new file mode 100644 index 0000000000000..a3c4ac386b290 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/MockableHybridConnectivitySubscriptionResource.cs @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridConnectivity.Models; + +namespace Azure.ResourceManager.HybridConnectivity.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableHybridConnectivitySubscriptionResource : ArmResource + { + private ClientDiagnostics _generateAwsTemplateClientDiagnostics; + private GenerateAwsTemplateRestOperations _generateAwsTemplateRestClient; + private ClientDiagnostics _publicCloudConnectorClientDiagnostics; + private PublicCloudConnectorsRestOperations _publicCloudConnectorRestClient; + private ClientDiagnostics _solutionTypeResourceSolutionTypesClientDiagnostics; + private SolutionTypesRestOperations _solutionTypeResourceSolutionTypesRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableHybridConnectivitySubscriptionResource() + { + } + + /// 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 MockableHybridConnectivitySubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics GenerateAwsTemplateClientDiagnostics => _generateAwsTemplateClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HybridConnectivity", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private GenerateAwsTemplateRestOperations GenerateAwsTemplateRestClient => _generateAwsTemplateRestClient ??= new GenerateAwsTemplateRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics PublicCloudConnectorClientDiagnostics => _publicCloudConnectorClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HybridConnectivity", PublicCloudConnectorResource.ResourceType.Namespace, Diagnostics); + private PublicCloudConnectorsRestOperations PublicCloudConnectorRestClient => _publicCloudConnectorRestClient ??= new PublicCloudConnectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(PublicCloudConnectorResource.ResourceType)); + private ClientDiagnostics SolutionTypeResourceSolutionTypesClientDiagnostics => _solutionTypeResourceSolutionTypesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HybridConnectivity", SolutionTypeResource.ResourceType.Namespace, Diagnostics); + private SolutionTypesRestOperations SolutionTypeResourceSolutionTypesRestClient => _solutionTypeResourceSolutionTypesRestClient ??= new SolutionTypesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(SolutionTypeResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Retrieve AWS Cloud Formation template + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/generateAwsTemplate + /// + /// + /// Operation Id + /// GenerateAwsTemplate_Post + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// + /// ConnectorId and SolutionTypes and their properties to Generate AWS CFT Template. + /// The cancellation token to use. + /// is null. + public virtual async Task> PostGenerateAwsTemplateAsync(GenerateAwsTemplateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = GenerateAwsTemplateClientDiagnostics.CreateScope("MockableHybridConnectivitySubscriptionResource.PostGenerateAwsTemplate"); + scope.Start(); + try + { + var response = await GenerateAwsTemplateRestClient.PostAsync(Id.SubscriptionId, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieve AWS Cloud Formation template + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/generateAwsTemplate + /// + /// + /// Operation Id + /// GenerateAwsTemplate_Post + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// + /// ConnectorId and SolutionTypes and their properties to Generate AWS CFT Template. + /// The cancellation token to use. + /// is null. + public virtual Response PostGenerateAwsTemplate(GenerateAwsTemplateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = GenerateAwsTemplateClientDiagnostics.CreateScope("MockableHybridConnectivitySubscriptionResource.PostGenerateAwsTemplate"); + scope.Start(); + try + { + var response = GenerateAwsTemplateRestClient.Post(Id.SubscriptionId, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List PublicCloudConnector resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/publicCloudConnectors + /// + /// + /// Operation Id + /// PublicCloudConnectors_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetPublicCloudConnectorsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PublicCloudConnectorRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PublicCloudConnectorRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PublicCloudConnectorResource(Client, PublicCloudConnectorData.DeserializePublicCloudConnectorData(e)), PublicCloudConnectorClientDiagnostics, Pipeline, "MockableHybridConnectivitySubscriptionResource.GetPublicCloudConnectors", "value", "nextLink", cancellationToken); + } + + /// + /// List PublicCloudConnector resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/publicCloudConnectors + /// + /// + /// Operation Id + /// PublicCloudConnectors_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetPublicCloudConnectors(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PublicCloudConnectorRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PublicCloudConnectorRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PublicCloudConnectorResource(Client, PublicCloudConnectorData.DeserializePublicCloudConnectorData(e)), PublicCloudConnectorClientDiagnostics, Pipeline, "MockableHybridConnectivitySubscriptionResource.GetPublicCloudConnectors", "value", "nextLink", cancellationToken); + } + + /// + /// List SolutionTypeResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/solutionTypes + /// + /// + /// Operation Id + /// SolutionTypes_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetSolutionTypeResourcesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => SolutionTypeResourceSolutionTypesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SolutionTypeResourceSolutionTypesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SolutionTypeResource(Client, SolutionTypeResourceData.DeserializeSolutionTypeResourceData(e)), SolutionTypeResourceSolutionTypesClientDiagnostics, Pipeline, "MockableHybridConnectivitySubscriptionResource.GetSolutionTypeResources", "value", "nextLink", cancellationToken); + } + + /// + /// List SolutionTypeResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/solutionTypes + /// + /// + /// Operation Id + /// SolutionTypes_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetSolutionTypeResources(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => SolutionTypeResourceSolutionTypesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SolutionTypeResourceSolutionTypesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SolutionTypeResource(Client, SolutionTypeResourceData.DeserializeSolutionTypeResourceData(e)), SolutionTypeResourceSolutionTypesClientDiagnostics, Pipeline, "MockableHybridConnectivitySubscriptionResource.GetSolutionTypeResources", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/HybridConnectivityInventoryResource.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/HybridConnectivityInventoryResource.Serialization.cs new file mode 100644 index 0000000000000..3a5740a26a375 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/HybridConnectivityInventoryResource.Serialization.cs @@ -0,0 +1,26 @@ +// 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.HybridConnectivity +{ + public partial class HybridConnectivityInventoryResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + HybridConnectivityInventoryResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + HybridConnectivityInventoryResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/HybridConnectivityInventoryResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/HybridConnectivityInventoryResource.cs new file mode 100644 index 0000000000000..a03a3cd2957f2 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/HybridConnectivityInventoryResource.cs @@ -0,0 +1,170 @@ +// 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; + +namespace Azure.ResourceManager.HybridConnectivity +{ + /// + /// A Class representing a HybridConnectivityInventoryResource 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 GetHybridConnectivityInventoryResource method. + /// Otherwise you can get one from its parent resource using the GetHybridConnectivityInventoryResource method. + /// + public partial class HybridConnectivityInventoryResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The resourceUri. + /// The solutionConfiguration. + /// The inventoryId. + public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, string solutionConfiguration, string inventoryId) + { + var resourceId = $"{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/inventory/{inventoryId}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _hybridConnectivityInventoryResourceInventoryClientDiagnostics; + private readonly InventoryRestOperations _hybridConnectivityInventoryResourceInventoryRestClient; + private readonly HybridConnectivityInventoryResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.HybridConnectivity/solutionConfigurations/inventory"; + + /// Initializes a new instance of the class for mocking. + protected HybridConnectivityInventoryResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal HybridConnectivityInventoryResource(ArmClient client, HybridConnectivityInventoryResourceData 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 HybridConnectivityInventoryResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _hybridConnectivityInventoryResourceInventoryClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridConnectivity", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string hybridConnectivityInventoryResourceInventoryApiVersion); + _hybridConnectivityInventoryResourceInventoryRestClient = new InventoryRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridConnectivityInventoryResourceInventoryApiVersion); +#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 HybridConnectivityInventoryResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a InventoryResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/inventory/{inventoryId} + /// + /// + /// Operation Id + /// Inventory_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _hybridConnectivityInventoryResourceInventoryClientDiagnostics.CreateScope("HybridConnectivityInventoryResource.Get"); + scope.Start(); + try + { + var response = await _hybridConnectivityInventoryResourceInventoryRestClient.GetAsync(Id.Parent.Parent, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HybridConnectivityInventoryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a InventoryResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/inventory/{inventoryId} + /// + /// + /// Operation Id + /// Inventory_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _hybridConnectivityInventoryResourceInventoryClientDiagnostics.CreateScope("HybridConnectivityInventoryResource.Get"); + scope.Start(); + try + { + var response = _hybridConnectivityInventoryResourceInventoryRestClient.Get(Id.Parent.Parent, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HybridConnectivityInventoryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/HybridConnectivityInventoryResourceCollection.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/HybridConnectivityInventoryResourceCollection.cs new file mode 100644 index 0000000000000..0e814cd53fc37 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/HybridConnectivityInventoryResourceCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.HybridConnectivity +{ + /// + /// 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 GetHybridConnectivityInventoryResources method from an instance of . + /// + public partial class HybridConnectivityInventoryResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _hybridConnectivityInventoryResourceInventoryClientDiagnostics; + private readonly InventoryRestOperations _hybridConnectivityInventoryResourceInventoryRestClient; + + /// Initializes a new instance of the class for mocking. + protected HybridConnectivityInventoryResourceCollection() + { + } + + /// 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 HybridConnectivityInventoryResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _hybridConnectivityInventoryResourceInventoryClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridConnectivity", HybridConnectivityInventoryResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(HybridConnectivityInventoryResource.ResourceType, out string hybridConnectivityInventoryResourceInventoryApiVersion); + _hybridConnectivityInventoryResourceInventoryRestClient = new InventoryRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridConnectivityInventoryResourceInventoryApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SolutionConfigurationResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SolutionConfigurationResource.ResourceType), nameof(id)); + } + + /// + /// Get a InventoryResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/inventory/{inventoryId} + /// + /// + /// Operation Id + /// Inventory_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Inventory 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 inventoryId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(inventoryId, nameof(inventoryId)); + + using var scope = _hybridConnectivityInventoryResourceInventoryClientDiagnostics.CreateScope("HybridConnectivityInventoryResourceCollection.Get"); + scope.Start(); + try + { + var response = await _hybridConnectivityInventoryResourceInventoryRestClient.GetAsync(Id.Parent, Id.Name, inventoryId, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HybridConnectivityInventoryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a InventoryResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/inventory/{inventoryId} + /// + /// + /// Operation Id + /// Inventory_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Inventory resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string inventoryId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(inventoryId, nameof(inventoryId)); + + using var scope = _hybridConnectivityInventoryResourceInventoryClientDiagnostics.CreateScope("HybridConnectivityInventoryResourceCollection.Get"); + scope.Start(); + try + { + var response = _hybridConnectivityInventoryResourceInventoryRestClient.Get(Id.Parent, Id.Name, inventoryId, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HybridConnectivityInventoryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List InventoryResource resources by SolutionConfiguration + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/inventory + /// + /// + /// Operation Id + /// Inventory_ListBySolutionConfiguration + /// + /// + /// Default Api Version + /// 2024-12-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) => _hybridConnectivityInventoryResourceInventoryRestClient.CreateListBySolutionConfigurationRequest(Id.Parent, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridConnectivityInventoryResourceInventoryRestClient.CreateListBySolutionConfigurationNextPageRequest(nextLink, Id.Parent, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridConnectivityInventoryResource(Client, HybridConnectivityInventoryResourceData.DeserializeHybridConnectivityInventoryResourceData(e)), _hybridConnectivityInventoryResourceInventoryClientDiagnostics, Pipeline, "HybridConnectivityInventoryResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List InventoryResource resources by SolutionConfiguration + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/inventory + /// + /// + /// Operation Id + /// Inventory_ListBySolutionConfiguration + /// + /// + /// Default Api Version + /// 2024-12-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) => _hybridConnectivityInventoryResourceInventoryRestClient.CreateListBySolutionConfigurationRequest(Id.Parent, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridConnectivityInventoryResourceInventoryRestClient.CreateListBySolutionConfigurationNextPageRequest(nextLink, Id.Parent, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridConnectivityInventoryResource(Client, HybridConnectivityInventoryResourceData.DeserializeHybridConnectivityInventoryResourceData(e)), _hybridConnectivityInventoryResourceInventoryClientDiagnostics, Pipeline, "HybridConnectivityInventoryResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/inventory/{inventoryId} + /// + /// + /// Operation Id + /// Inventory_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Inventory 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 inventoryId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(inventoryId, nameof(inventoryId)); + + using var scope = _hybridConnectivityInventoryResourceInventoryClientDiagnostics.CreateScope("HybridConnectivityInventoryResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _hybridConnectivityInventoryResourceInventoryRestClient.GetAsync(Id.Parent, Id.Name, inventoryId, 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.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/inventory/{inventoryId} + /// + /// + /// Operation Id + /// Inventory_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Inventory resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string inventoryId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(inventoryId, nameof(inventoryId)); + + using var scope = _hybridConnectivityInventoryResourceInventoryClientDiagnostics.CreateScope("HybridConnectivityInventoryResourceCollection.Exists"); + scope.Start(); + try + { + var response = _hybridConnectivityInventoryResourceInventoryRestClient.Get(Id.Parent, Id.Name, inventoryId, 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.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/inventory/{inventoryId} + /// + /// + /// Operation Id + /// Inventory_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Inventory 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 inventoryId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(inventoryId, nameof(inventoryId)); + + using var scope = _hybridConnectivityInventoryResourceInventoryClientDiagnostics.CreateScope("HybridConnectivityInventoryResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _hybridConnectivityInventoryResourceInventoryRestClient.GetAsync(Id.Parent, Id.Name, inventoryId, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new HybridConnectivityInventoryResource(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.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/inventory/{inventoryId} + /// + /// + /// Operation Id + /// Inventory_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Inventory resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string inventoryId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(inventoryId, nameof(inventoryId)); + + using var scope = _hybridConnectivityInventoryResourceInventoryClientDiagnostics.CreateScope("HybridConnectivityInventoryResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _hybridConnectivityInventoryResourceInventoryRestClient.Get(Id.Parent, Id.Name, inventoryId, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new HybridConnectivityInventoryResource(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/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/HybridConnectivityInventoryResourceData.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/HybridConnectivityInventoryResourceData.Serialization.cs new file mode 100644 index 0000000000000..6daa93428bd8a --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/HybridConnectivityInventoryResourceData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.HybridConnectivity.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + public partial class HybridConnectivityInventoryResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HybridConnectivityInventoryResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + HybridConnectivityInventoryResourceData 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(HybridConnectivityInventoryResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHybridConnectivityInventoryResourceData(document.RootElement, options); + } + + internal static HybridConnectivityInventoryResourceData DeserializeHybridConnectivityInventoryResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HybridConnectivityInventoryProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = 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) + { + continue; + } + properties = HybridConnectivityInventoryProperties.DeserializeHybridConnectivityInventoryProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HybridConnectivityInventoryResourceData( + id, + name, + type, + systemData, + properties, + 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(HybridConnectivityInventoryResourceData)} does not support writing '{options.Format}' format."); + } + } + + HybridConnectivityInventoryResourceData 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 DeserializeHybridConnectivityInventoryResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HybridConnectivityInventoryResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/HybridConnectivityInventoryResourceData.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/HybridConnectivityInventoryResourceData.cs new file mode 100644 index 0000000000000..9f462a08eed1d --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/HybridConnectivityInventoryResourceData.cs @@ -0,0 +1,75 @@ +// 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.HybridConnectivity.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + /// + /// A class representing the HybridConnectivityInventoryResource data model. + /// Concrete proxy resource types can be created by aliasing this type using a specific property type. + /// + public partial class HybridConnectivityInventoryResourceData : 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 HybridConnectivityInventoryResourceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal HybridConnectivityInventoryResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, HybridConnectivityInventoryProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public HybridConnectivityInventoryProperties Properties { get; set; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/LongRunningOperation/OperationStatusResultOperationSource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/LongRunningOperation/OperationStatusResultOperationSource.cs new file mode 100644 index 0000000000000..27345abe2bee5 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/LongRunningOperation/OperationStatusResultOperationSource.cs @@ -0,0 +1,30 @@ +// 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; +using Azure.ResourceManager.HybridConnectivity.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + internal class OperationStatusResultOperationSource : IOperationSource + { + OperationStatusResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return OperationStatusResult.DeserializeOperationStatusResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return OperationStatusResult.DeserializeOperationStatusResult(document.RootElement); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/LongRunningOperation/PublicCloudConnectorOperationSource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/LongRunningOperation/PublicCloudConnectorOperationSource.cs new file mode 100644 index 0000000000000..4cc6921659312 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/LongRunningOperation/PublicCloudConnectorOperationSource.cs @@ -0,0 +1,38 @@ +// 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.HybridConnectivity +{ + internal class PublicCloudConnectorOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal PublicCloudConnectorOperationSource(ArmClient client) + { + _client = client; + } + + PublicCloudConnectorResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = PublicCloudConnectorData.DeserializePublicCloudConnectorData(document.RootElement); + return new PublicCloudConnectorResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = PublicCloudConnectorData.DeserializePublicCloudConnectorData(document.RootElement); + return new PublicCloudConnectorResource(_client, data); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/AwsCloudProfile.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/AwsCloudProfile.Serialization.cs new file mode 100644 index 0000000000000..3151234a58146 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/AwsCloudProfile.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + public partial class AwsCloudProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AwsCloudProfile)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("accountId"u8); + writer.WriteStringValue(AccountId); + if (Optional.IsCollectionDefined(ExcludedAccounts)) + { + writer.WritePropertyName("excludedAccounts"u8); + writer.WriteStartArray(); + foreach (var item in ExcludedAccounts) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(IsOrganizationalAccount)) + { + writer.WritePropertyName("isOrganizationalAccount"u8); + writer.WriteBooleanValue(IsOrganizationalAccount.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AwsCloudProfile 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(AwsCloudProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAwsCloudProfile(document.RootElement, options); + } + + internal static AwsCloudProfile DeserializeAwsCloudProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string accountId = default; + IList excludedAccounts = default; + bool? isOrganizationalAccount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("accountId"u8)) + { + accountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("excludedAccounts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + excludedAccounts = array; + continue; + } + if (property.NameEquals("isOrganizationalAccount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isOrganizationalAccount = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AwsCloudProfile(accountId, excludedAccounts ?? new ChangeTrackingList(), isOrganizationalAccount, 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(AwsCloudProfile)} does not support writing '{options.Format}' format."); + } + } + + AwsCloudProfile 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 DeserializeAwsCloudProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AwsCloudProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/AwsCloudProfile.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/AwsCloudProfile.cs new file mode 100644 index 0000000000000..e5e95b6b58f75 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/AwsCloudProfile.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// cloud profile for AWS. + public partial class AwsCloudProfile + { + /// + /// 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 . + /// Account id for the AWS account. + /// is null. + public AwsCloudProfile(string accountId) + { + Argument.AssertNotNull(accountId, nameof(accountId)); + + AccountId = accountId; + ExcludedAccounts = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Account id for the AWS account. + /// List of AWS accounts which need to be excluded. + /// Boolean value that indicates whether the account is organizational or not. True represents organization account, whereas false represents a single account. + /// Keeps track of any properties unknown to the library. + internal AwsCloudProfile(string accountId, IList excludedAccounts, bool? isOrganizationalAccount, IDictionary serializedAdditionalRawData) + { + AccountId = accountId; + ExcludedAccounts = excludedAccounts; + IsOrganizationalAccount = isOrganizationalAccount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AwsCloudProfile() + { + } + + /// Account id for the AWS account. + public string AccountId { get; set; } + /// List of AWS accounts which need to be excluded. + public IList ExcludedAccounts { get; } + /// Boolean value that indicates whether the account is organizational or not. True represents organization account, whereas false represents a single account. + public bool? IsOrganizationalAccount { get; set; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/AwsCloudProfileUpdate.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/AwsCloudProfileUpdate.Serialization.cs new file mode 100644 index 0000000000000..60e1541e77a09 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/AwsCloudProfileUpdate.Serialization.cs @@ -0,0 +1,143 @@ +// 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.HybridConnectivity.Models +{ + internal partial class AwsCloudProfileUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AwsCloudProfileUpdate)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(ExcludedAccounts)) + { + writer.WritePropertyName("excludedAccounts"u8); + writer.WriteStartArray(); + foreach (var item in ExcludedAccounts) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + 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 + } + } + } + + AwsCloudProfileUpdate 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(AwsCloudProfileUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAwsCloudProfileUpdate(document.RootElement, options); + } + + internal static AwsCloudProfileUpdate DeserializeAwsCloudProfileUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList excludedAccounts = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("excludedAccounts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + excludedAccounts = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AwsCloudProfileUpdate(excludedAccounts ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AwsCloudProfileUpdate)} does not support writing '{options.Format}' format."); + } + } + + AwsCloudProfileUpdate 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 DeserializeAwsCloudProfileUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AwsCloudProfileUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/AwsCloudProfileUpdate.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/AwsCloudProfileUpdate.cs new file mode 100644 index 0000000000000..70271adb5514a --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/AwsCloudProfileUpdate.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// cloud profile for AWS. + internal partial class AwsCloudProfileUpdate + { + /// + /// 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 AwsCloudProfileUpdate() + { + ExcludedAccounts = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of AWS accounts which need to be excluded. + /// Keeps track of any properties unknown to the library. + internal AwsCloudProfileUpdate(IList excludedAccounts, IDictionary serializedAdditionalRawData) + { + ExcludedAccounts = excludedAccounts; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of AWS accounts which need to be excluded. + public IList ExcludedAccounts { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/CreatedByType.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/CreatedByType.cs deleted file mode 100644 index edb33222828ed..0000000000000 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/CreatedByType.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.HybridConnectivity.Models -{ - /// The type of identity that created the resource. - public readonly partial struct CreatedByType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CreatedByType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string UserValue = "User"; - private const string ApplicationValue = "Application"; - private const string ManagedIdentityValue = "ManagedIdentity"; - private const string KeyValue = "Key"; - - /// User. - public static CreatedByType User { get; } = new CreatedByType(UserValue); - /// Application. - public static CreatedByType Application { get; } = new CreatedByType(ApplicationValue); - /// ManagedIdentity. - public static CreatedByType ManagedIdentity { get; } = new CreatedByType(ManagedIdentityValue); - /// Key. - public static CreatedByType Key { get; } = new CreatedByType(KeyValue); - /// Determines if two values are the same. - public static bool operator ==(CreatedByType left, CreatedByType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CreatedByType left, CreatedByType right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator CreatedByType(string value) => new CreatedByType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CreatedByType other && Equals(other); - /// - public bool Equals(CreatedByType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/GenerateAwsTemplateContent.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/GenerateAwsTemplateContent.Serialization.cs new file mode 100644 index 0000000000000..0a408de6387be --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/GenerateAwsTemplateContent.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + public partial class GenerateAwsTemplateContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GenerateAwsTemplateContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("connectorId"u8); + writer.WriteStringValue(ConnectorId); + if (Optional.IsCollectionDefined(SolutionTypes)) + { + writer.WritePropertyName("solutionTypes"u8); + writer.WriteStartArray(); + foreach (var item in SolutionTypes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + 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 + } + } + } + + GenerateAwsTemplateContent 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(GenerateAwsTemplateContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGenerateAwsTemplateContent(document.RootElement, options); + } + + internal static GenerateAwsTemplateContent DeserializeGenerateAwsTemplateContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier connectorId = default; + IList solutionTypes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("connectorId"u8)) + { + connectorId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("solutionTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SolutionTypeSettings.DeserializeSolutionTypeSettings(item, options)); + } + solutionTypes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GenerateAwsTemplateContent(connectorId, solutionTypes ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GenerateAwsTemplateContent)} does not support writing '{options.Format}' format."); + } + } + + GenerateAwsTemplateContent 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 DeserializeGenerateAwsTemplateContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GenerateAwsTemplateContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/GenerateAwsTemplateContent.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/GenerateAwsTemplateContent.cs new file mode 100644 index 0000000000000..e0b110ab2d549 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/GenerateAwsTemplateContent.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// ConnectorId and SolutionTypes and their properties to Generate AWS CFT Template. + public partial class GenerateAwsTemplateContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of public cloud connector. + /// is null. + public GenerateAwsTemplateContent(ResourceIdentifier connectorId) + { + Argument.AssertNotNull(connectorId, nameof(connectorId)); + + ConnectorId = connectorId; + SolutionTypes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The name of public cloud connector. + /// The list of solution types and their settings. + /// Keeps track of any properties unknown to the library. + internal GenerateAwsTemplateContent(ResourceIdentifier connectorId, IList solutionTypes, IDictionary serializedAdditionalRawData) + { + ConnectorId = connectorId; + SolutionTypes = solutionTypes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GenerateAwsTemplateContent() + { + } + + /// The name of public cloud connector. + public ResourceIdentifier ConnectorId { get; } + /// The list of solution types and their settings. + public IList SolutionTypes { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityCloudNativeType.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityCloudNativeType.cs new file mode 100644 index 0000000000000..bba4a3ea15744 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityCloudNativeType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Cloud Native Type enum. + public readonly partial struct HybridConnectivityCloudNativeType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HybridConnectivityCloudNativeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Ec2Value = "ec2"; + + /// ec2 enum. + public static HybridConnectivityCloudNativeType Ec2 { get; } = new HybridConnectivityCloudNativeType(Ec2Value); + /// Determines if two values are the same. + public static bool operator ==(HybridConnectivityCloudNativeType left, HybridConnectivityCloudNativeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HybridConnectivityCloudNativeType left, HybridConnectivityCloudNativeType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator HybridConnectivityCloudNativeType(string value) => new HybridConnectivityCloudNativeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HybridConnectivityCloudNativeType other && Equals(other); + /// + public bool Equals(HybridConnectivityCloudNativeType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityEndpointProperties.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityEndpointProperties.Serialization.cs new file mode 100644 index 0000000000000..e3e5433fa9822 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityEndpointProperties.Serialization.cs @@ -0,0 +1,152 @@ +// 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.HybridConnectivity.Models +{ + public partial class HybridConnectivityEndpointProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HybridConnectivityEndpointProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState); + } + 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 + } + } + } + + HybridConnectivityEndpointProperties 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(HybridConnectivityEndpointProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHybridConnectivityEndpointProperties(document.RootElement, options); + } + + internal static HybridConnectivityEndpointProperties DeserializeHybridConnectivityEndpointProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointType type = default; + ResourceIdentifier resourceId = default; + string provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("resourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + provisioningState = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HybridConnectivityEndpointProperties(type, resourceId, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HybridConnectivityEndpointProperties)} does not support writing '{options.Format}' format."); + } + } + + HybridConnectivityEndpointProperties 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 DeserializeHybridConnectivityEndpointProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HybridConnectivityEndpointProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityEndpointProperties.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityEndpointProperties.cs new file mode 100644 index 0000000000000..961a7274b5602 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityEndpointProperties.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Endpoint details. + public partial class HybridConnectivityEndpointProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The type of endpoint. + public HybridConnectivityEndpointProperties(EndpointType endpointType) + { + EndpointType = endpointType; + } + + /// Initializes a new instance of . + /// The type of endpoint. + /// The resource Id of the connectivity endpoint (optional). + /// The resource provisioning state. + /// Keeps track of any properties unknown to the library. + internal HybridConnectivityEndpointProperties(EndpointType endpointType, ResourceIdentifier resourceId, string provisioningState, IDictionary serializedAdditionalRawData) + { + EndpointType = endpointType; + ResourceId = resourceId; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HybridConnectivityEndpointProperties() + { + } + + /// The type of endpoint. + public EndpointType EndpointType { get; set; } + /// The resource Id of the connectivity endpoint (optional). + public ResourceIdentifier ResourceId { get; set; } + /// The resource provisioning state. + public string ProvisioningState { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityHostType.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityHostType.cs new file mode 100644 index 0000000000000..0dc254d69489f --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityHostType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Enum of host cloud the public cloud connector is referencing. + public readonly partial struct HybridConnectivityHostType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HybridConnectivityHostType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AWSValue = "AWS"; + + /// AWS state. + public static HybridConnectivityHostType AWS { get; } = new HybridConnectivityHostType(AWSValue); + /// Determines if two values are the same. + public static bool operator ==(HybridConnectivityHostType left, HybridConnectivityHostType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HybridConnectivityHostType left, HybridConnectivityHostType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator HybridConnectivityHostType(string value) => new HybridConnectivityHostType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HybridConnectivityHostType other && Equals(other); + /// + public bool Equals(HybridConnectivityHostType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityInventoryProperties.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityInventoryProperties.Serialization.cs new file mode 100644 index 0000000000000..a1866e7612038 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityInventoryProperties.Serialization.cs @@ -0,0 +1,207 @@ +// 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.HybridConnectivity.Models +{ + public partial class HybridConnectivityInventoryProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HybridConnectivityInventoryProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CloudNativeType)) + { + writer.WritePropertyName("cloudNativeType"u8); + writer.WriteStringValue(CloudNativeType.Value.ToString()); + } + if (Optional.IsDefined(CloudNativeResourceId)) + { + writer.WritePropertyName("cloudNativeResourceId"u8); + writer.WriteStringValue(CloudNativeResourceId); + } + if (Optional.IsDefined(AzureResourceId)) + { + writer.WritePropertyName("azureResourceId"u8); + writer.WriteStringValue(AzureResourceId); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(StatusDetails)) + { + writer.WritePropertyName("statusDetails"u8); + writer.WriteStringValue(StatusDetails); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HybridConnectivityInventoryProperties 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(HybridConnectivityInventoryProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHybridConnectivityInventoryProperties(document.RootElement, options); + } + + internal static HybridConnectivityInventoryProperties DeserializeHybridConnectivityInventoryProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HybridConnectivityCloudNativeType? cloudNativeType = default; + string cloudNativeResourceId = default; + ResourceIdentifier azureResourceId = default; + SolutionConfigurationStatus? status = default; + string statusDetails = default; + HybridConnectivityResourceProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("cloudNativeType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cloudNativeType = new HybridConnectivityCloudNativeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("cloudNativeResourceId"u8)) + { + cloudNativeResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("azureResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new SolutionConfigurationStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("statusDetails"u8)) + { + statusDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new HybridConnectivityResourceProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HybridConnectivityInventoryProperties( + cloudNativeType, + cloudNativeResourceId, + azureResourceId, + status, + statusDetails, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HybridConnectivityInventoryProperties)} does not support writing '{options.Format}' format."); + } + } + + HybridConnectivityInventoryProperties 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 DeserializeHybridConnectivityInventoryProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HybridConnectivityInventoryProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityInventoryProperties.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityInventoryProperties.cs new file mode 100644 index 0000000000000..6f6b1253e19b6 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityInventoryProperties.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Definition of inventory. + public partial class HybridConnectivityInventoryProperties + { + /// + /// 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 HybridConnectivityInventoryProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the cloud native resource type. + /// Gets or sets the cloud native resource name. + /// Gets or sets the mapped azure resource id. + /// Gets or sets the status of the inventory. + /// Gets or sets the status details. + /// The resource provisioning state. + /// Keeps track of any properties unknown to the library. + internal HybridConnectivityInventoryProperties(HybridConnectivityCloudNativeType? cloudNativeType, string cloudNativeResourceId, ResourceIdentifier azureResourceId, SolutionConfigurationStatus? status, string statusDetails, HybridConnectivityResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + CloudNativeType = cloudNativeType; + CloudNativeResourceId = cloudNativeResourceId; + AzureResourceId = azureResourceId; + Status = status; + StatusDetails = statusDetails; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the cloud native resource type. + public HybridConnectivityCloudNativeType? CloudNativeType { get; set; } + /// Gets or sets the cloud native resource name. + public string CloudNativeResourceId { get; set; } + /// Gets or sets the mapped azure resource id. + public ResourceIdentifier AzureResourceId { get; set; } + /// Gets or sets the status of the inventory. + public SolutionConfigurationStatus? Status { get; set; } + /// Gets or sets the status details. + public string StatusDetails { get; set; } + /// The resource provisioning state. + public HybridConnectivityResourceProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityProvisioningState.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityProvisioningState.cs new file mode 100644 index 0000000000000..bd76cc119eb26 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityProvisioningState.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// The resource provisioning state. + public readonly partial struct HybridConnectivityProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HybridConnectivityProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string CreatingValue = "Creating"; + private const string UpdatingValue = "Updating"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Succeeded. + public static HybridConnectivityProvisioningState Succeeded { get; } = new HybridConnectivityProvisioningState(SucceededValue); + /// Creating. + public static HybridConnectivityProvisioningState Creating { get; } = new HybridConnectivityProvisioningState(CreatingValue); + /// Updating. + public static HybridConnectivityProvisioningState Updating { get; } = new HybridConnectivityProvisioningState(UpdatingValue); + /// Failed. + public static HybridConnectivityProvisioningState Failed { get; } = new HybridConnectivityProvisioningState(FailedValue); + /// Canceled. + public static HybridConnectivityProvisioningState Canceled { get; } = new HybridConnectivityProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(HybridConnectivityProvisioningState left, HybridConnectivityProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HybridConnectivityProvisioningState left, HybridConnectivityProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator HybridConnectivityProvisioningState(string value) => new HybridConnectivityProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HybridConnectivityProvisioningState other && Equals(other); + /// + public bool Equals(HybridConnectivityProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityResourceProvisioningState.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityResourceProvisioningState.cs new file mode 100644 index 0000000000000..cf8059cb153b4 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityResourceProvisioningState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// The provisioning state of a resource type. + public readonly partial struct HybridConnectivityResourceProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HybridConnectivityResourceProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Resource has been created. + public static HybridConnectivityResourceProvisioningState Succeeded { get; } = new HybridConnectivityResourceProvisioningState(SucceededValue); + /// Resource creation failed. + public static HybridConnectivityResourceProvisioningState Failed { get; } = new HybridConnectivityResourceProvisioningState(FailedValue); + /// Resource creation was canceled. + public static HybridConnectivityResourceProvisioningState Canceled { get; } = new HybridConnectivityResourceProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(HybridConnectivityResourceProvisioningState left, HybridConnectivityResourceProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HybridConnectivityResourceProvisioningState left, HybridConnectivityResourceProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator HybridConnectivityResourceProvisioningState(string value) => new HybridConnectivityResourceProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HybridConnectivityResourceProvisioningState other && Equals(other); + /// + public bool Equals(HybridConnectivityResourceProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityServiceName.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityServiceName.cs new file mode 100644 index 0000000000000..28b4425b30c40 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/HybridConnectivityServiceName.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Name of the service. + public readonly partial struct HybridConnectivityServiceName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HybridConnectivityServiceName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SSHValue = "SSH"; + private const string WACValue = "WAC"; + + /// SSH. + public static HybridConnectivityServiceName SSH { get; } = new HybridConnectivityServiceName(SSHValue); + /// WAC. + public static HybridConnectivityServiceName WAC { get; } = new HybridConnectivityServiceName(WACValue); + /// Determines if two values are the same. + public static bool operator ==(HybridConnectivityServiceName left, HybridConnectivityServiceName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HybridConnectivityServiceName left, HybridConnectivityServiceName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator HybridConnectivityServiceName(string value) => new HybridConnectivityServiceName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HybridConnectivityServiceName other && Equals(other); + /// + public bool Equals(HybridConnectivityServiceName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/IngressGatewayAsset.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/IngressGatewayAsset.Serialization.cs new file mode 100644 index 0000000000000..da77768334731 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/IngressGatewayAsset.Serialization.cs @@ -0,0 +1,284 @@ +// 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.HybridConnectivity.Models +{ + public partial class IngressGatewayAsset : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IngressGatewayAsset)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("ingress"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Hostname)) + { + writer.WritePropertyName("hostname"u8); + writer.WriteStringValue(Hostname); + } + writer.WritePropertyName("aadProfile"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ServerId)) + { + writer.WritePropertyName("serverId"u8); + writer.WriteStringValue(ServerId); + } + if (Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + writer.WritePropertyName("relay"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(NamespaceName)) + { + writer.WritePropertyName("namespaceName"u8); + writer.WriteStringValue(NamespaceName); + } + if (Optional.IsDefined(NamespaceNameSuffix)) + { + writer.WritePropertyName("namespaceNameSuffix"u8); + writer.WriteStringValue(NamespaceNameSuffix); + } + if (Optional.IsDefined(HybridConnectionName)) + { + writer.WritePropertyName("hybridConnectionName"u8); + writer.WriteStringValue(HybridConnectionName); + } + if (options.Format != "W" && Optional.IsDefined(AccessKey)) + { + writer.WritePropertyName("accessKey"u8); + writer.WriteStringValue(AccessKey); + } + if (Optional.IsDefined(ExpiresOn)) + { + writer.WritePropertyName("expiresOn"u8); + writer.WriteNumberValue(ExpiresOn.Value); + } + if (Optional.IsDefined(ServiceConfigurationToken)) + { + writer.WritePropertyName("serviceConfigurationToken"u8); + writer.WriteStringValue(ServiceConfigurationToken); + } + 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 + } + } + } + + IngressGatewayAsset 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(IngressGatewayAsset)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIngressGatewayAsset(document.RootElement, options); + } + + internal static IngressGatewayAsset DeserializeIngressGatewayAsset(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string hostname = default; + ResourceIdentifier serverId = default; + Guid? tenantId = default; + string namespaceName = default; + string namespaceNameSuffix = default; + string hybridConnectionName = default; + string accessKey = default; + long? expiresOn = default; + string serviceConfigurationToken = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ingress"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("hostname"u8)) + { + hostname = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("aadProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property1 in property0.Value.EnumerateObject()) + { + if (property1.NameEquals("serverId"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serverId = new ResourceIdentifier(property1.Value.GetString()); + continue; + } + if (property1.NameEquals("tenantId"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tenantId = property1.Value.GetGuid(); + continue; + } + } + continue; + } + } + continue; + } + if (property.NameEquals("relay"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("namespaceName"u8)) + { + namespaceName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("namespaceNameSuffix"u8)) + { + namespaceNameSuffix = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hybridConnectionName"u8)) + { + hybridConnectionName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("accessKey"u8)) + { + accessKey = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("expiresOn"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiresOn = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("serviceConfigurationToken"u8)) + { + serviceConfigurationToken = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IngressGatewayAsset( + hostname, + serverId, + tenantId, + namespaceName, + namespaceNameSuffix, + hybridConnectionName, + accessKey, + expiresOn, + serviceConfigurationToken, + 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(IngressGatewayAsset)} does not support writing '{options.Format}' format."); + } + } + + IngressGatewayAsset 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 DeserializeIngressGatewayAsset(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IngressGatewayAsset)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/IngressGatewayAsset.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/IngressGatewayAsset.cs new file mode 100644 index 0000000000000..92b029b525c63 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/IngressGatewayAsset.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// The ingress gateway access credentials. + public partial class IngressGatewayAsset + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal IngressGatewayAsset() + { + } + + /// Initializes a new instance of . + /// The ingress hostname. + /// The arc ingress gateway server app id. + /// The target resource home tenant id. + /// The namespace name. + /// The suffix domain name of relay namespace. + /// Azure Relay hybrid connection name for the resource. + /// Access key for hybrid connection. + /// The expiration of access key in unix time. + /// The token to access the enabled service. + /// Keeps track of any properties unknown to the library. + internal IngressGatewayAsset(string hostname, ResourceIdentifier serverId, Guid? tenantId, string namespaceName, string namespaceNameSuffix, string hybridConnectionName, string accessKey, long? expiresOn, string serviceConfigurationToken, IDictionary serializedAdditionalRawData) + { + Hostname = hostname; + ServerId = serverId; + TenantId = tenantId; + NamespaceName = namespaceName; + NamespaceNameSuffix = namespaceNameSuffix; + HybridConnectionName = hybridConnectionName; + AccessKey = accessKey; + ExpiresOn = expiresOn; + ServiceConfigurationToken = serviceConfigurationToken; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The ingress hostname. + public string Hostname { get; } + /// The arc ingress gateway server app id. + public ResourceIdentifier ServerId { get; } + /// The target resource home tenant id. + public Guid? TenantId { get; } + /// The namespace name. + public string NamespaceName { get; } + /// The suffix domain name of relay namespace. + public string NamespaceNameSuffix { get; } + /// Azure Relay hybrid connection name for the resource. + public string HybridConnectionName { get; } + /// Access key for hybrid connection. + public string AccessKey { get; } + /// The expiration of access key in unix time. + public long? ExpiresOn { get; } + /// The token to access the enabled service. + public string ServiceConfigurationToken { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/InventoryResourceListResult.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/InventoryResourceListResult.Serialization.cs new file mode 100644 index 0000000000000..45e4a8de24c49 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/InventoryResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + internal partial class InventoryResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InventoryResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InventoryResourceListResult 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(InventoryResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInventoryResourceListResult(document.RootElement, options); + } + + internal static InventoryResourceListResult DeserializeInventoryResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HybridConnectivityInventoryResourceData.DeserializeHybridConnectivityInventoryResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InventoryResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InventoryResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + InventoryResourceListResult 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 DeserializeInventoryResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InventoryResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/InventoryResourceListResult.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/InventoryResourceListResult.cs new file mode 100644 index 0000000000000..837f05c7fc8ff --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/InventoryResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// The response of a InventoryResource list operation. + internal partial class InventoryResourceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The InventoryResource items on this page. + /// is null. + internal InventoryResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The InventoryResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal InventoryResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InventoryResourceListResult() + { + } + + /// The InventoryResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ListCredentialsContent.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ListCredentialsContent.Serialization.cs new file mode 100644 index 0000000000000..c7c271671e598 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ListCredentialsContent.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + public partial class ListCredentialsContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ListCredentialsContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ServiceName)) + { + writer.WritePropertyName("serviceName"u8); + writer.WriteStringValue(ServiceName.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ListCredentialsContent 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(ListCredentialsContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeListCredentialsContent(document.RootElement, options); + } + + internal static ListCredentialsContent DeserializeListCredentialsContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HybridConnectivityServiceName? serviceName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serviceName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceName = new HybridConnectivityServiceName(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ListCredentialsContent(serviceName, 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(ListCredentialsContent)} does not support writing '{options.Format}' format."); + } + } + + ListCredentialsContent 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 DeserializeListCredentialsContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ListCredentialsContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ListCredentialsContent.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ListCredentialsContent.cs new file mode 100644 index 0000000000000..ad67ad07b0edc --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ListCredentialsContent.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// The details of the service for which credentials needs to be returned. + public partial class ListCredentialsContent + { + /// + /// 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 ListCredentialsContent() + { + } + + /// Initializes a new instance of . + /// The name of the service. If not provided, the request will by pass the generation of service configuration token. + /// Keeps track of any properties unknown to the library. + internal ListCredentialsContent(HybridConnectivityServiceName? serviceName, IDictionary serializedAdditionalRawData) + { + ServiceName = serviceName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the service. If not provided, the request will by pass the generation of service configuration token. + public HybridConnectivityServiceName? ServiceName { get; set; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ListIngressGatewayCredentialsContent.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ListIngressGatewayCredentialsContent.Serialization.cs new file mode 100644 index 0000000000000..a182a5bd5d10b --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ListIngressGatewayCredentialsContent.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + public partial class ListIngressGatewayCredentialsContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ListIngressGatewayCredentialsContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ServiceName)) + { + writer.WritePropertyName("serviceName"u8); + writer.WriteStringValue(ServiceName.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ListIngressGatewayCredentialsContent 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(ListIngressGatewayCredentialsContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeListIngressGatewayCredentialsContent(document.RootElement, options); + } + + internal static ListIngressGatewayCredentialsContent DeserializeListIngressGatewayCredentialsContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HybridConnectivityServiceName? serviceName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serviceName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceName = new HybridConnectivityServiceName(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ListIngressGatewayCredentialsContent(serviceName, 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(ListIngressGatewayCredentialsContent)} does not support writing '{options.Format}' format."); + } + } + + ListIngressGatewayCredentialsContent 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 DeserializeListIngressGatewayCredentialsContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ListIngressGatewayCredentialsContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ListIngressGatewayCredentialsContent.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ListIngressGatewayCredentialsContent.cs new file mode 100644 index 0000000000000..86b90d6cdce42 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ListIngressGatewayCredentialsContent.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Represent ListIngressGatewayCredentials Request object. + public partial class ListIngressGatewayCredentialsContent + { + /// + /// 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 ListIngressGatewayCredentialsContent() + { + } + + /// Initializes a new instance of . + /// The name of the service. + /// Keeps track of any properties unknown to the library. + internal ListIngressGatewayCredentialsContent(HybridConnectivityServiceName? serviceName, IDictionary serializedAdditionalRawData) + { + ServiceName = serviceName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the service. + public HybridConnectivityServiceName? ServiceName { get; set; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyAsset.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyAsset.Serialization.cs new file mode 100644 index 0000000000000..c2edf8fe4a890 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyAsset.Serialization.cs @@ -0,0 +1,134 @@ +// 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.HybridConnectivity.Models +{ + public partial class ManagedProxyAsset : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedProxyAsset)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("proxy"u8); + writer.WriteStringValue(Proxy); + writer.WritePropertyName("expiresOn"u8); + writer.WriteNumberValue(ExpiresOn); + 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 + } + } + } + + ManagedProxyAsset 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(ManagedProxyAsset)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedProxyAsset(document.RootElement, options); + } + + internal static ManagedProxyAsset DeserializeManagedProxyAsset(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string proxy = default; + long expiresOn = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("proxy"u8)) + { + proxy = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiresOn"u8)) + { + expiresOn = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedProxyAsset(proxy, expiresOn, 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(ManagedProxyAsset)} does not support writing '{options.Format}' format."); + } + } + + ManagedProxyAsset 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 DeserializeManagedProxyAsset(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedProxyAsset)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyAsset.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyAsset.cs new file mode 100644 index 0000000000000..78e813eece7e2 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyAsset.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Managed Proxy. + public partial class ManagedProxyAsset + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The short lived proxy name. + /// The expiration time of short lived proxy name in unix epoch. + /// is null. + internal ManagedProxyAsset(string proxy, long expiresOn) + { + Argument.AssertNotNull(proxy, nameof(proxy)); + + Proxy = proxy; + ExpiresOn = expiresOn; + } + + /// Initializes a new instance of . + /// The short lived proxy name. + /// The expiration time of short lived proxy name in unix epoch. + /// Keeps track of any properties unknown to the library. + internal ManagedProxyAsset(string proxy, long expiresOn, IDictionary serializedAdditionalRawData) + { + Proxy = proxy; + ExpiresOn = expiresOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ManagedProxyAsset() + { + } + + /// The short lived proxy name. + public string Proxy { get; } + /// The expiration time of short lived proxy name in unix epoch. + public long ExpiresOn { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyContent.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyContent.Serialization.cs new file mode 100644 index 0000000000000..29c332bb81373 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyContent.Serialization.cs @@ -0,0 +1,152 @@ +// 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.HybridConnectivity.Models +{ + public partial class ManagedProxyContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedProxyContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("service"u8); + writer.WriteStringValue(Service); + if (Optional.IsDefined(Hostname)) + { + writer.WritePropertyName("hostname"u8); + writer.WriteStringValue(Hostname); + } + if (Optional.IsDefined(ServiceName)) + { + writer.WritePropertyName("serviceName"u8); + writer.WriteStringValue(ServiceName.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedProxyContent 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(ManagedProxyContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedProxyContent(document.RootElement, options); + } + + internal static ManagedProxyContent DeserializeManagedProxyContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string service = default; + string hostname = default; + HybridConnectivityServiceName? serviceName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("service"u8)) + { + service = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostname"u8)) + { + hostname = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceName = new HybridConnectivityServiceName(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedProxyContent(service, hostname, serviceName, 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(ManagedProxyContent)} does not support writing '{options.Format}' format."); + } + } + + ManagedProxyContent 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 DeserializeManagedProxyContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedProxyContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyContent.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyContent.cs new file mode 100644 index 0000000000000..c9d95d4cd2b52 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyContent.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Represent ManageProxy Request object. + public partial class ManagedProxyContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the service. + /// is null. + public ManagedProxyContent(string service) + { + Argument.AssertNotNull(service, nameof(service)); + + Service = service; + } + + /// Initializes a new instance of . + /// The name of the service. + /// The target host name. + /// The name of the service. It is an optional property, if not provided, service configuration tokens issue code would be by passed. + /// Keeps track of any properties unknown to the library. + internal ManagedProxyContent(string service, string hostname, HybridConnectivityServiceName? serviceName, IDictionary serializedAdditionalRawData) + { + Service = service; + Hostname = hostname; + ServiceName = serviceName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ManagedProxyContent() + { + } + + /// The name of the service. + public string Service { get; } + /// The target host name. + public string Hostname { get; set; } + /// The name of the service. It is an optional property, if not provided, service configuration tokens issue code would be by passed. + public HybridConnectivityServiceName? ServiceName { get; set; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/OperationStatusResult.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/OperationStatusResult.Serialization.cs new file mode 100644 index 0000000000000..fd684fa9500ea --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/OperationStatusResult.Serialization.cs @@ -0,0 +1,262 @@ +// 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.HybridConnectivity.Models +{ + public partial class OperationStatusResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationStatusResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + if (Optional.IsDefined(PercentComplete)) + { + writer.WritePropertyName("percentComplete"u8); + writer.WriteNumberValue(PercentComplete.Value); + } + if (Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (Optional.IsCollectionDefined(Operations)) + { + writer.WritePropertyName("operations"u8); + writer.WriteStartArray(); + foreach (var item in Operations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + } + 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 + } + } + } + + OperationStatusResult 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(OperationStatusResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationStatusResult(document.RootElement, options); + } + + internal static OperationStatusResult DeserializeOperationStatusResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + ResourceIdentifier resourceId = default; + string name = default; + string status = default; + float? percentComplete = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + IReadOnlyList operations = default; + ResponseError error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("resourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("percentComplete"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentComplete = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("operations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeOperationStatusResult(item, options)); + } + operations = array; + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperationStatusResult( + id, + resourceId, + name, + status, + percentComplete, + startTime, + endTime, + operations ?? new ChangeTrackingList(), + error, + 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(OperationStatusResult)} does not support writing '{options.Format}' format."); + } + } + + OperationStatusResult 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 DeserializeOperationStatusResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationStatusResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/OperationStatusResult.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/OperationStatusResult.cs new file mode 100644 index 0000000000000..9b129e1242e78 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/OperationStatusResult.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// The current status of an async operation. + public partial class OperationStatusResult + { + /// + /// 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 . + /// Operation status. + /// is null. + internal OperationStatusResult(string status) + { + Argument.AssertNotNull(status, nameof(status)); + + Status = status; + Operations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Fully qualified ID for the async operation. + /// Fully qualified ID of the resource against which the original async operation was started. + /// Name of the async operation. + /// Operation status. + /// Percent of the operation that is complete. + /// The start time of the operation. + /// The end time of the operation. + /// The operations list. + /// If present, details of the operation error. + /// Keeps track of any properties unknown to the library. + internal OperationStatusResult(ResourceIdentifier id, ResourceIdentifier resourceId, string name, string status, float? percentComplete, DateTimeOffset? startOn, DateTimeOffset? endOn, IReadOnlyList operations, ResponseError error, IDictionary serializedAdditionalRawData) + { + Id = id; + ResourceId = resourceId; + Name = name; + Status = status; + PercentComplete = percentComplete; + StartOn = startOn; + EndOn = endOn; + Operations = operations; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OperationStatusResult() + { + } + + /// Fully qualified ID for the async operation. + public ResourceIdentifier Id { get; } + /// Fully qualified ID of the resource against which the original async operation was started. + public ResourceIdentifier ResourceId { get; } + /// Name of the async operation. + public string Name { get; } + /// Operation status. + public string Status { get; } + /// Percent of the operation that is complete. + public float? PercentComplete { get; } + /// The start time of the operation. + public DateTimeOffset? StartOn { get; } + /// The end time of the operation. + public DateTimeOffset? EndOn { get; } + /// The operations list. + public IReadOnlyList Operations { get; } + /// If present, details of the operation error. + public ResponseError Error { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorListResult.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorListResult.Serialization.cs new file mode 100644 index 0000000000000..da8c26834b0bd --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + internal partial class PublicCloudConnectorListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PublicCloudConnectorListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PublicCloudConnectorListResult 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(PublicCloudConnectorListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePublicCloudConnectorListResult(document.RootElement, options); + } + + internal static PublicCloudConnectorListResult DeserializePublicCloudConnectorListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PublicCloudConnectorData.DeserializePublicCloudConnectorData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PublicCloudConnectorListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PublicCloudConnectorListResult)} does not support writing '{options.Format}' format."); + } + } + + PublicCloudConnectorListResult 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 DeserializePublicCloudConnectorListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PublicCloudConnectorListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorListResult.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorListResult.cs new file mode 100644 index 0000000000000..4702336687491 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// The response of a PublicCloudConnector list operation. + internal partial class PublicCloudConnectorListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The PublicCloudConnector items on this page. + /// is null. + internal PublicCloudConnectorListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The PublicCloudConnector items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal PublicCloudConnectorListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PublicCloudConnectorListResult() + { + } + + /// The PublicCloudConnector items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorPatch.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorPatch.Serialization.cs new file mode 100644 index 0000000000000..25f45dc723f1e --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorPatch.Serialization.cs @@ -0,0 +1,181 @@ +// 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; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + public partial class PublicCloudConnectorPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PublicCloudConnectorPatch)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + } + + PublicCloudConnectorPatch 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(PublicCloudConnectorPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePublicCloudConnectorPatch(document.RootElement, options); + } + + internal static PublicCloudConnectorPatch DeserializePublicCloudConnectorPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PublicCloudConnectorPropertiesUpdate properties = default; + IDictionary tags = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = 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) + { + continue; + } + properties = PublicCloudConnectorPropertiesUpdate.DeserializePublicCloudConnectorPropertiesUpdate(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PublicCloudConnectorPatch( + id, + name, + type, + systemData, + properties, + tags ?? new ChangeTrackingDictionary(), + 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(PublicCloudConnectorPatch)} does not support writing '{options.Format}' format."); + } + } + + PublicCloudConnectorPatch 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 DeserializePublicCloudConnectorPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PublicCloudConnectorPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorPatch.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorPatch.cs new file mode 100644 index 0000000000000..03f0267e037a8 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorPatch.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Public Cloud Connector. + public partial class PublicCloudConnectorPatch : 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 PublicCloudConnectorPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Resource tags. + /// Keeps track of any properties unknown to the library. + internal PublicCloudConnectorPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, PublicCloudConnectorPropertiesUpdate properties, IDictionary tags, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + internal PublicCloudConnectorPropertiesUpdate Properties { get; set; } + /// List of AWS accounts which need to be excluded. + public IList AwsCloudExcludedAccounts + { + get + { + if (Properties is null) + Properties = new PublicCloudConnectorPropertiesUpdate(); + return Properties.AwsCloudExcludedAccounts; + } + } + + /// Resource tags. + public IDictionary Tags { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorProperties.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorProperties.Serialization.cs new file mode 100644 index 0000000000000..8e38632ba183f --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorProperties.Serialization.cs @@ -0,0 +1,164 @@ +// 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.HybridConnectivity.Models +{ + public partial class PublicCloudConnectorProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PublicCloudConnectorProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("awsCloudProfile"u8); + writer.WriteObjectValue(AwsCloudProfile, options); + writer.WritePropertyName("hostType"u8); + writer.WriteStringValue(HostType.ToString()); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ConnectorPrimaryIdentifier)) + { + writer.WritePropertyName("connectorPrimaryIdentifier"u8); + writer.WriteStringValue(ConnectorPrimaryIdentifier.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PublicCloudConnectorProperties 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(PublicCloudConnectorProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePublicCloudConnectorProperties(document.RootElement, options); + } + + internal static PublicCloudConnectorProperties DeserializePublicCloudConnectorProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AwsCloudProfile awsCloudProfile = default; + HybridConnectivityHostType hostType = default; + HybridConnectivityResourceProvisioningState? provisioningState = default; + Guid? connectorPrimaryIdentifier = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("awsCloudProfile"u8)) + { + awsCloudProfile = AwsCloudProfile.DeserializeAwsCloudProfile(property.Value, options); + continue; + } + if (property.NameEquals("hostType"u8)) + { + hostType = new HybridConnectivityHostType(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new HybridConnectivityResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("connectorPrimaryIdentifier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectorPrimaryIdentifier = property.Value.GetGuid(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PublicCloudConnectorProperties(awsCloudProfile, hostType, provisioningState, connectorPrimaryIdentifier, 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(PublicCloudConnectorProperties)} does not support writing '{options.Format}' format."); + } + } + + PublicCloudConnectorProperties 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 DeserializePublicCloudConnectorProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PublicCloudConnectorProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorProperties.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorProperties.cs new file mode 100644 index 0000000000000..4a9877a077ad7 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorProperties.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Properties of public cloud connectors. + public partial class PublicCloudConnectorProperties + { + /// + /// 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 . + /// Cloud profile for AWS. + /// Host cloud the public cloud connector. + /// is null. + public PublicCloudConnectorProperties(AwsCloudProfile awsCloudProfile, HybridConnectivityHostType hostType) + { + Argument.AssertNotNull(awsCloudProfile, nameof(awsCloudProfile)); + + AwsCloudProfile = awsCloudProfile; + HostType = hostType; + } + + /// Initializes a new instance of . + /// Cloud profile for AWS. + /// Host cloud the public cloud connector. + /// The resource provisioning state. + /// Connector primary identifier. + /// Keeps track of any properties unknown to the library. + internal PublicCloudConnectorProperties(AwsCloudProfile awsCloudProfile, HybridConnectivityHostType hostType, HybridConnectivityResourceProvisioningState? provisioningState, Guid? connectorPrimaryIdentifier, IDictionary serializedAdditionalRawData) + { + AwsCloudProfile = awsCloudProfile; + HostType = hostType; + ProvisioningState = provisioningState; + ConnectorPrimaryIdentifier = connectorPrimaryIdentifier; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PublicCloudConnectorProperties() + { + } + + /// Cloud profile for AWS. + public AwsCloudProfile AwsCloudProfile { get; set; } + /// Host cloud the public cloud connector. + public HybridConnectivityHostType HostType { get; set; } + /// The resource provisioning state. + public HybridConnectivityResourceProvisioningState? ProvisioningState { get; } + /// Connector primary identifier. + public Guid? ConnectorPrimaryIdentifier { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorPropertiesUpdate.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorPropertiesUpdate.Serialization.cs new file mode 100644 index 0000000000000..8f1f39406e2eb --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorPropertiesUpdate.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + internal partial class PublicCloudConnectorPropertiesUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PublicCloudConnectorPropertiesUpdate)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AwsCloudProfile)) + { + writer.WritePropertyName("awsCloudProfile"u8); + writer.WriteObjectValue(AwsCloudProfile, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PublicCloudConnectorPropertiesUpdate 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(PublicCloudConnectorPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePublicCloudConnectorPropertiesUpdate(document.RootElement, options); + } + + internal static PublicCloudConnectorPropertiesUpdate DeserializePublicCloudConnectorPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AwsCloudProfileUpdate awsCloudProfile = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("awsCloudProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + awsCloudProfile = AwsCloudProfileUpdate.DeserializeAwsCloudProfileUpdate(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PublicCloudConnectorPropertiesUpdate(awsCloudProfile, 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(PublicCloudConnectorPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + PublicCloudConnectorPropertiesUpdate 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 DeserializePublicCloudConnectorPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PublicCloudConnectorPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorPropertiesUpdate.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorPropertiesUpdate.cs new file mode 100644 index 0000000000000..016e9d94d76e6 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/PublicCloudConnectorPropertiesUpdate.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Properties of public cloud connectors. + internal partial class PublicCloudConnectorPropertiesUpdate + { + /// + /// 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 PublicCloudConnectorPropertiesUpdate() + { + } + + /// Initializes a new instance of . + /// Cloud profile for AWS. + /// Keeps track of any properties unknown to the library. + internal PublicCloudConnectorPropertiesUpdate(AwsCloudProfileUpdate awsCloudProfile, IDictionary serializedAdditionalRawData) + { + AwsCloudProfile = awsCloudProfile; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Cloud profile for AWS. + internal AwsCloudProfileUpdate AwsCloudProfile { get; set; } + /// List of AWS accounts which need to be excluded. + public IList AwsCloudExcludedAccounts + { + get + { + if (AwsCloudProfile is null) + AwsCloudProfile = new AwsCloudProfileUpdate(); + return AwsCloudProfile.ExcludedAccounts; + } + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfigurationList.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfigurationList.Serialization.cs new file mode 100644 index 0000000000000..be1876f939bff --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfigurationList.Serialization.cs @@ -0,0 +1,154 @@ +// 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.HybridConnectivity.Models +{ + internal partial class ServiceConfigurationList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceConfigurationList)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ServiceConfigurationList 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(ServiceConfigurationList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceConfigurationList(document.RootElement, options); + } + + internal static ServiceConfigurationList DeserializeServiceConfigurationList(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ServiceConfigurationResourceData.DeserializeServiceConfigurationResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServiceConfigurationList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServiceConfigurationList)} does not support writing '{options.Format}' format."); + } + } + + ServiceConfigurationList 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 DeserializeServiceConfigurationList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServiceConfigurationList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfigurationList.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfigurationList.cs new file mode 100644 index 0000000000000..ac7fa853b9e46 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfigurationList.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// The paginated list of serviceConfigurations. + internal partial class ServiceConfigurationList + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ServiceConfigurationList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of service configuration. + /// The link to fetch the next page of connected cluster. + /// Keeps track of any properties unknown to the library. + internal ServiceConfigurationList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of service configuration. + public IReadOnlyList Value { get; } + /// The link to fetch the next page of connected cluster. + public string NextLink { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfigurationResourcePatch.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfigurationResourcePatch.Serialization.cs new file mode 100644 index 0000000000000..b4a0fa98e8741 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfigurationResourcePatch.Serialization.cs @@ -0,0 +1,148 @@ +// 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.HybridConnectivity.Models +{ + public partial class ServiceConfigurationResourcePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceConfigurationResourcePatch)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Port)) + { + writer.WritePropertyName("port"u8); + writer.WriteNumberValue(Port.Value); + } + 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 + } + } + } + + ServiceConfigurationResourcePatch 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(ServiceConfigurationResourcePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceConfigurationResourcePatch(document.RootElement, options); + } + + internal static ServiceConfigurationResourcePatch DeserializeServiceConfigurationResourcePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? port = 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("port"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + port = property0.Value.GetInt64(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServiceConfigurationResourcePatch(port, 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(ServiceConfigurationResourcePatch)} does not support writing '{options.Format}' format."); + } + } + + ServiceConfigurationResourcePatch 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 DeserializeServiceConfigurationResourcePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServiceConfigurationResourcePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfigurationResourcePatch.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfigurationResourcePatch.cs new file mode 100644 index 0000000000000..4456b7913291b --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfigurationResourcePatch.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// The service details under service configuration for the target endpoint resource. + public partial class ServiceConfigurationResourcePatch + { + /// + /// 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 ServiceConfigurationResourcePatch() + { + } + + /// Initializes a new instance of . + /// The port on which service is enabled. + /// Keeps track of any properties unknown to the library. + internal ServiceConfigurationResourcePatch(long? port, IDictionary serializedAdditionalRawData) + { + Port = port; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The port on which service is enabled. + public long? Port { get; set; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationListResult.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationListResult.Serialization.cs new file mode 100644 index 0000000000000..96ad933380afc --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + internal partial class SolutionConfigurationListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SolutionConfigurationListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SolutionConfigurationListResult 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(SolutionConfigurationListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSolutionConfigurationListResult(document.RootElement, options); + } + + internal static SolutionConfigurationListResult DeserializeSolutionConfigurationListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SolutionConfigurationData.DeserializeSolutionConfigurationData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SolutionConfigurationListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SolutionConfigurationListResult)} does not support writing '{options.Format}' format."); + } + } + + SolutionConfigurationListResult 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 DeserializeSolutionConfigurationListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SolutionConfigurationListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationListResult.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationListResult.cs new file mode 100644 index 0000000000000..4b86d7a296a1b --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// The response of a SolutionConfiguration list operation. + internal partial class SolutionConfigurationListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The SolutionConfiguration items on this page. + /// is null. + internal SolutionConfigurationListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SolutionConfiguration items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SolutionConfigurationListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SolutionConfigurationListResult() + { + } + + /// The SolutionConfiguration items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationPatch.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationPatch.Serialization.cs new file mode 100644 index 0000000000000..c44e3632d7c5b --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationPatch.Serialization.cs @@ -0,0 +1,154 @@ +// 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; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + public partial class SolutionConfigurationPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SolutionConfigurationPatch)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + SolutionConfigurationPatch 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(SolutionConfigurationPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSolutionConfigurationPatch(document.RootElement, options); + } + + internal static SolutionConfigurationPatch DeserializeSolutionConfigurationPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SolutionConfigurationPropertiesUpdate properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = 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) + { + continue; + } + properties = SolutionConfigurationPropertiesUpdate.DeserializeSolutionConfigurationPropertiesUpdate(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SolutionConfigurationPatch( + id, + name, + type, + systemData, + properties, + 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(SolutionConfigurationPatch)} does not support writing '{options.Format}' format."); + } + } + + SolutionConfigurationPatch 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 DeserializeSolutionConfigurationPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SolutionConfigurationPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationPatch.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationPatch.cs new file mode 100644 index 0000000000000..a6f93517368da --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationPatch.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Solution Configuration. + public partial class SolutionConfigurationPatch : 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 SolutionConfigurationPatch() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal SolutionConfigurationPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SolutionConfigurationPropertiesUpdate properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public SolutionConfigurationPropertiesUpdate Properties { get; set; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationProperties.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationProperties.Serialization.cs new file mode 100644 index 0000000000000..070c00e7c3f52 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationProperties.Serialization.cs @@ -0,0 +1,215 @@ +// 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.HybridConnectivity.Models +{ + public partial class SolutionConfigurationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SolutionConfigurationProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("solutionType"u8); + writer.WriteStringValue(SolutionType); + if (Optional.IsCollectionDefined(SolutionSettings)) + { + writer.WritePropertyName("solutionSettings"u8); + writer.WriteStartObject(); + foreach (var item in SolutionSettings) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(StatusDetails)) + { + writer.WritePropertyName("statusDetails"u8); + writer.WriteStringValue(StatusDetails); + } + if (options.Format != "W" && Optional.IsDefined(LastSyncOn)) + { + writer.WritePropertyName("lastSyncTime"u8); + writer.WriteStringValue(LastSyncOn.Value, "O"); + } + 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 + } + } + } + + SolutionConfigurationProperties 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(SolutionConfigurationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSolutionConfigurationProperties(document.RootElement, options); + } + + internal static SolutionConfigurationProperties DeserializeSolutionConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HybridConnectivityResourceProvisioningState? provisioningState = default; + string solutionType = default; + IDictionary solutionSettings = default; + SolutionConfigurationStatus? status = default; + string statusDetails = default; + DateTimeOffset? lastSyncTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new HybridConnectivityResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("solutionType"u8)) + { + solutionType = property.Value.GetString(); + continue; + } + if (property.NameEquals("solutionSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + solutionSettings = dictionary; + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new SolutionConfigurationStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("statusDetails"u8)) + { + statusDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastSyncTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSyncTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SolutionConfigurationProperties( + provisioningState, + solutionType, + solutionSettings ?? new ChangeTrackingDictionary(), + status, + statusDetails, + lastSyncTime, + 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(SolutionConfigurationProperties)} does not support writing '{options.Format}' format."); + } + } + + SolutionConfigurationProperties 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 DeserializeSolutionConfigurationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SolutionConfigurationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationProperties.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationProperties.cs new file mode 100644 index 0000000000000..880f5bda6a0bb --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationProperties.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Solution configuration resource. + public partial class SolutionConfigurationProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The type of the solution. + /// is null. + public SolutionConfigurationProperties(string solutionType) + { + Argument.AssertNotNull(solutionType, nameof(solutionType)); + + SolutionType = solutionType; + SolutionSettings = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The resource provisioning state. + /// The type of the solution. + /// Solution settings. + /// The status of solution configurations. + /// The detailed message of status details. + /// The last time resources were inventoried. + /// Keeps track of any properties unknown to the library. + internal SolutionConfigurationProperties(HybridConnectivityResourceProvisioningState? provisioningState, string solutionType, IDictionary solutionSettings, SolutionConfigurationStatus? status, string statusDetails, DateTimeOffset? lastSyncOn, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + SolutionType = solutionType; + SolutionSettings = solutionSettings; + Status = status; + StatusDetails = statusDetails; + LastSyncOn = lastSyncOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SolutionConfigurationProperties() + { + } + + /// The resource provisioning state. + public HybridConnectivityResourceProvisioningState? ProvisioningState { get; } + /// The type of the solution. + public string SolutionType { get; set; } + /// Solution settings. + public IDictionary SolutionSettings { get; } + /// The status of solution configurations. + public SolutionConfigurationStatus? Status { get; } + /// The detailed message of status details. + public string StatusDetails { get; } + /// The last time resources were inventoried. + public DateTimeOffset? LastSyncOn { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationPropertiesUpdate.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationPropertiesUpdate.Serialization.cs new file mode 100644 index 0000000000000..51d4a68ba0b11 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationPropertiesUpdate.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + public partial class SolutionConfigurationPropertiesUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SolutionConfigurationPropertiesUpdate)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SolutionType)) + { + writer.WritePropertyName("solutionType"u8); + writer.WriteStringValue(SolutionType); + } + if (Optional.IsCollectionDefined(SolutionSettings)) + { + writer.WritePropertyName("solutionSettings"u8); + writer.WriteStartObject(); + foreach (var item in SolutionSettings) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + 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 + } + } + } + + SolutionConfigurationPropertiesUpdate 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(SolutionConfigurationPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSolutionConfigurationPropertiesUpdate(document.RootElement, options); + } + + internal static SolutionConfigurationPropertiesUpdate DeserializeSolutionConfigurationPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string solutionType = default; + IDictionary solutionSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("solutionType"u8)) + { + solutionType = property.Value.GetString(); + continue; + } + if (property.NameEquals("solutionSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + solutionSettings = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SolutionConfigurationPropertiesUpdate(solutionType, solutionSettings ?? new ChangeTrackingDictionary(), 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(SolutionConfigurationPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + SolutionConfigurationPropertiesUpdate 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 DeserializeSolutionConfigurationPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SolutionConfigurationPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationPropertiesUpdate.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationPropertiesUpdate.cs new file mode 100644 index 0000000000000..c7e22de5b6fe3 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationPropertiesUpdate.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Solution configuration resource. + public partial class SolutionConfigurationPropertiesUpdate + { + /// + /// 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 SolutionConfigurationPropertiesUpdate() + { + SolutionSettings = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The type of the solution. + /// Solution settings. + /// Keeps track of any properties unknown to the library. + internal SolutionConfigurationPropertiesUpdate(string solutionType, IDictionary solutionSettings, IDictionary serializedAdditionalRawData) + { + SolutionType = solutionType; + SolutionSettings = solutionSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of the solution. + public string SolutionType { get; set; } + /// Solution settings. + public IDictionary SolutionSettings { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationStatus.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationStatus.cs new file mode 100644 index 0000000000000..b9ab234a1721c --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionConfigurationStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Solution Configuration Status. + public readonly partial struct SolutionConfigurationStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SolutionConfigurationStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NewValue = "New"; + private const string InProgressValue = "InProgress"; + private const string CompletedValue = "Completed"; + private const string FailedValue = "Failed"; + + /// New status. + public static SolutionConfigurationStatus New { get; } = new SolutionConfigurationStatus(NewValue); + /// InProgress status. + public static SolutionConfigurationStatus InProgress { get; } = new SolutionConfigurationStatus(InProgressValue); + /// Canceled status. + public static SolutionConfigurationStatus Completed { get; } = new SolutionConfigurationStatus(CompletedValue); + /// Failed status. + public static SolutionConfigurationStatus Failed { get; } = new SolutionConfigurationStatus(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(SolutionConfigurationStatus left, SolutionConfigurationStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SolutionConfigurationStatus left, SolutionConfigurationStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SolutionConfigurationStatus(string value) => new SolutionConfigurationStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SolutionConfigurationStatus other && Equals(other); + /// + public bool Equals(SolutionConfigurationStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeProperties.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeProperties.Serialization.cs new file mode 100644 index 0000000000000..eb6b48e035381 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeProperties.Serialization.cs @@ -0,0 +1,190 @@ +// 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.HybridConnectivity.Models +{ + public partial class SolutionTypeProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SolutionTypeProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SolutionType)) + { + writer.WritePropertyName("solutionType"u8); + writer.WriteStringValue(SolutionType); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsCollectionDefined(SupportedAzureRegions)) + { + writer.WritePropertyName("supportedAzureRegions"u8); + writer.WriteStartArray(); + foreach (var item in SupportedAzureRegions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(SolutionSettings)) + { + writer.WritePropertyName("solutionSettings"u8); + writer.WriteStartArray(); + foreach (var item in SolutionSettings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + 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 + } + } + } + + SolutionTypeProperties 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(SolutionTypeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSolutionTypeProperties(document.RootElement, options); + } + + internal static SolutionTypeProperties DeserializeSolutionTypeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string solutionType = default; + string description = default; + IList supportedAzureRegions = default; + IList solutionSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("solutionType"u8)) + { + solutionType = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("supportedAzureRegions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + supportedAzureRegions = array; + continue; + } + if (property.NameEquals("solutionSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SolutionTypeSettingsProperties.DeserializeSolutionTypeSettingsProperties(item, options)); + } + solutionSettings = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SolutionTypeProperties(solutionType, description, supportedAzureRegions ?? new ChangeTrackingList(), solutionSettings ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SolutionTypeProperties)} does not support writing '{options.Format}' format."); + } + } + + SolutionTypeProperties 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 DeserializeSolutionTypeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SolutionTypeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeProperties.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeProperties.cs new file mode 100644 index 0000000000000..0d1b6588e4702 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeProperties.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Definition of Solution type resource. + public partial class SolutionTypeProperties + { + /// + /// 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 SolutionTypeProperties() + { + SupportedAzureRegions = new ChangeTrackingList(); + SolutionSettings = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The name of the solution type. + /// Short description of solution type. + /// The locations this solution is supported in. + /// Array of solution settings and its description. + /// Keeps track of any properties unknown to the library. + internal SolutionTypeProperties(string solutionType, string description, IList supportedAzureRegions, IList solutionSettings, IDictionary serializedAdditionalRawData) + { + SolutionType = solutionType; + Description = description; + SupportedAzureRegions = supportedAzureRegions; + SolutionSettings = solutionSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the solution type. + public string SolutionType { get; set; } + /// Short description of solution type. + public string Description { get; set; } + /// The locations this solution is supported in. + public IList SupportedAzureRegions { get; } + /// Array of solution settings and its description. + public IList SolutionSettings { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeResourceListResult.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeResourceListResult.Serialization.cs new file mode 100644 index 0000000000000..0a31c1503b840 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + internal partial class SolutionTypeResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SolutionTypeResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SolutionTypeResourceListResult 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(SolutionTypeResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSolutionTypeResourceListResult(document.RootElement, options); + } + + internal static SolutionTypeResourceListResult DeserializeSolutionTypeResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SolutionTypeResourceData.DeserializeSolutionTypeResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SolutionTypeResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SolutionTypeResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + SolutionTypeResourceListResult 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 DeserializeSolutionTypeResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SolutionTypeResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeResourceListResult.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeResourceListResult.cs new file mode 100644 index 0000000000000..9f13c5fe866f2 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// The response of a SolutionTypeResource list operation. + internal partial class SolutionTypeResourceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The SolutionTypeResource items on this page. + /// is null. + internal SolutionTypeResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SolutionTypeResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SolutionTypeResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SolutionTypeResourceListResult() + { + } + + /// The SolutionTypeResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeSettings.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeSettings.Serialization.cs new file mode 100644 index 0000000000000..3a97aff138a42 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeSettings.Serialization.cs @@ -0,0 +1,152 @@ +// 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.HybridConnectivity.Models +{ + public partial class SolutionTypeSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SolutionTypeSettings)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("solutionType"u8); + writer.WriteStringValue(SolutionType); + if (Optional.IsCollectionDefined(SolutionSettings)) + { + writer.WritePropertyName("solutionSettings"u8); + writer.WriteStartObject(); + foreach (var item in SolutionSettings) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + 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 + } + } + } + + SolutionTypeSettings 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(SolutionTypeSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSolutionTypeSettings(document.RootElement, options); + } + + internal static SolutionTypeSettings DeserializeSolutionTypeSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string solutionType = default; + IDictionary solutionSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("solutionType"u8)) + { + solutionType = property.Value.GetString(); + continue; + } + if (property.NameEquals("solutionSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + solutionSettings = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SolutionTypeSettings(solutionType, solutionSettings ?? new ChangeTrackingDictionary(), 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(SolutionTypeSettings)} does not support writing '{options.Format}' format."); + } + } + + SolutionTypeSettings 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 DeserializeSolutionTypeSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SolutionTypeSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeSettings.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeSettings.cs new file mode 100644 index 0000000000000..fe99504126716 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeSettings.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// The properties of Solution Type. + public partial class SolutionTypeSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The type of the solution. + /// is null. + public SolutionTypeSettings(string solutionType) + { + Argument.AssertNotNull(solutionType, nameof(solutionType)); + + SolutionType = solutionType; + SolutionSettings = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The type of the solution. + /// Solution settings. + /// Keeps track of any properties unknown to the library. + internal SolutionTypeSettings(string solutionType, IDictionary solutionSettings, IDictionary serializedAdditionalRawData) + { + SolutionType = solutionType; + SolutionSettings = solutionSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SolutionTypeSettings() + { + } + + /// The type of the solution. + public string SolutionType { get; } + /// Solution settings. + public IDictionary SolutionSettings { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeSettingsProperties.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeSettingsProperties.Serialization.cs new file mode 100644 index 0000000000000..5ed72fee100d2 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeSettingsProperties.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + public partial class SolutionTypeSettingsProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SolutionTypeSettingsProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SolutionTypeSettingsPropertiesType); + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + writer.WritePropertyName("allowedValues"u8); + writer.WriteStartArray(); + foreach (var item in AllowedValues) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("defaultValue"u8); + writer.WriteStringValue(DefaultValue); + 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 + } + } + } + + SolutionTypeSettingsProperties 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(SolutionTypeSettingsProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSolutionTypeSettingsProperties(document.RootElement, options); + } + + internal static SolutionTypeSettingsProperties DeserializeSolutionTypeSettingsProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string displayName = default; + string type = default; + string description = default; + IList allowedValues = default; + string defaultValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("allowedValues"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedValues = array; + continue; + } + if (property.NameEquals("defaultValue"u8)) + { + defaultValue = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SolutionTypeSettingsProperties( + name, + displayName, + type, + description, + allowedValues, + defaultValue, + 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(SolutionTypeSettingsProperties)} does not support writing '{options.Format}' format."); + } + } + + SolutionTypeSettingsProperties 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 DeserializeSolutionTypeSettingsProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SolutionTypeSettingsProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeSettingsProperties.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeSettingsProperties.cs new file mode 100644 index 0000000000000..7ae0608185400 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/SolutionTypeSettingsProperties.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Represent Solution settings properties description array. + public partial class SolutionTypeSettingsProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the solution setting property. + /// The UI friendly name of the solution setting property. + /// Type of the solution setting property, represented as a string. + /// Description of solution setting property. + /// Array of allowed values for this solution settings property. + /// Default value for this solution settings property. + /// , , , , or is null. + public SolutionTypeSettingsProperties(string name, string displayName, string solutionTypeSettingsPropertiesType, string description, IEnumerable allowedValues, string defaultValue) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(displayName, nameof(displayName)); + Argument.AssertNotNull(solutionTypeSettingsPropertiesType, nameof(solutionTypeSettingsPropertiesType)); + Argument.AssertNotNull(description, nameof(description)); + Argument.AssertNotNull(allowedValues, nameof(allowedValues)); + Argument.AssertNotNull(defaultValue, nameof(defaultValue)); + + Name = name; + DisplayName = displayName; + SolutionTypeSettingsPropertiesType = solutionTypeSettingsPropertiesType; + Description = description; + AllowedValues = allowedValues.ToList(); + DefaultValue = defaultValue; + } + + /// Initializes a new instance of . + /// The name of the solution setting property. + /// The UI friendly name of the solution setting property. + /// Type of the solution setting property, represented as a string. + /// Description of solution setting property. + /// Array of allowed values for this solution settings property. + /// Default value for this solution settings property. + /// Keeps track of any properties unknown to the library. + internal SolutionTypeSettingsProperties(string name, string displayName, string solutionTypeSettingsPropertiesType, string description, IList allowedValues, string defaultValue, IDictionary serializedAdditionalRawData) + { + Name = name; + DisplayName = displayName; + SolutionTypeSettingsPropertiesType = solutionTypeSettingsPropertiesType; + Description = description; + AllowedValues = allowedValues; + DefaultValue = defaultValue; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SolutionTypeSettingsProperties() + { + } + + /// The name of the solution setting property. + public string Name { get; set; } + /// The UI friendly name of the solution setting property. + public string DisplayName { get; set; } + /// Type of the solution setting property, represented as a string. + public string SolutionTypeSettingsPropertiesType { get; set; } + /// Description of solution setting property. + public string Description { get; set; } + /// Array of allowed values for this solution settings property. + public IList AllowedValues { get; } + /// Default value for this solution settings property. + public string DefaultValue { get; set; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/TargetResourceEndpointAccess.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/TargetResourceEndpointAccess.Serialization.cs index cf6fe7511ada0..52978fcabaa2f 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/TargetResourceEndpointAccess.Serialization.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/TargetResourceEndpointAccess.Serialization.cs @@ -61,6 +61,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("expiresOn"u8); writer.WriteNumberValue(ExpiresOn.Value); } + if (Optional.IsDefined(ServiceConfigurationToken)) + { + writer.WritePropertyName("serviceConfigurationToken"u8); + writer.WriteStringValue(ServiceConfigurationToken); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -104,6 +109,7 @@ internal static TargetResourceEndpointAccess DeserializeTargetResourceEndpointAc string hybridConnectionName = default; string accessKey = default; long? expiresOn = default; + string serviceConfigurationToken = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -146,6 +152,11 @@ internal static TargetResourceEndpointAccess DeserializeTargetResourceEndpointAc expiresOn = property0.Value.GetInt64(); continue; } + if (property0.NameEquals("serviceConfigurationToken"u8)) + { + serviceConfigurationToken = property0.Value.GetString(); + continue; + } } continue; } @@ -161,6 +172,7 @@ internal static TargetResourceEndpointAccess DeserializeTargetResourceEndpointAc hybridConnectionName, accessKey, expiresOn, + serviceConfigurationToken, serializedAdditionalRawData); } diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/TargetResourceEndpointAccess.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/TargetResourceEndpointAccess.cs index d9c3c1eef0787..e79427d11cdbc 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/TargetResourceEndpointAccess.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/TargetResourceEndpointAccess.cs @@ -56,14 +56,16 @@ internal TargetResourceEndpointAccess() /// Azure Relay hybrid connection name for the resource. /// Access key for hybrid connection. /// The expiration of access key in unix time. + /// The token to access the enabled service. /// Keeps track of any properties unknown to the library. - internal TargetResourceEndpointAccess(string namespaceName, string namespaceNameSuffix, string hybridConnectionName, string accessKey, long? expiresOn, IDictionary serializedAdditionalRawData) + internal TargetResourceEndpointAccess(string namespaceName, string namespaceNameSuffix, string hybridConnectionName, string accessKey, long? expiresOn, string serviceConfigurationToken, IDictionary serializedAdditionalRawData) { NamespaceName = namespaceName; NamespaceNameSuffix = namespaceNameSuffix; HybridConnectionName = hybridConnectionName; AccessKey = accessKey; ExpiresOn = expiresOn; + ServiceConfigurationToken = serviceConfigurationToken; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -77,5 +79,7 @@ internal TargetResourceEndpointAccess(string namespaceName, string namespaceName public string AccessKey { get; } /// The expiration of access key in unix time. public long? ExpiresOn { get; } + /// The token to access the enabled service. + public string ServiceConfigurationToken { get; } } } diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/PublicCloudConnectorCollection.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/PublicCloudConnectorCollection.cs new file mode 100644 index 0000000000000..847fc0c425a84 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/PublicCloudConnectorCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.HybridConnectivity +{ + /// + /// 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 GetPublicCloudConnectors method from an instance of . + /// + public partial class PublicCloudConnectorCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _publicCloudConnectorClientDiagnostics; + private readonly PublicCloudConnectorsRestOperations _publicCloudConnectorRestClient; + + /// Initializes a new instance of the class for mocking. + protected PublicCloudConnectorCollection() + { + } + + /// 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 PublicCloudConnectorCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _publicCloudConnectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridConnectivity", PublicCloudConnectorResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(PublicCloudConnectorResource.ResourceType, out string publicCloudConnectorApiVersion); + _publicCloudConnectorRestClient = new PublicCloudConnectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, publicCloudConnectorApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a PublicCloudConnector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-12-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. + /// Represent public cloud connectors resource. + /// Resource create parameters. + /// 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 publicCloudConnector, PublicCloudConnectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _publicCloudConnectorRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, publicCloudConnector, data, cancellationToken).ConfigureAwait(false); + var operation = new HybridConnectivityArmOperation(new PublicCloudConnectorOperationSource(Client), _publicCloudConnectorClientDiagnostics, Pipeline, _publicCloudConnectorRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, publicCloudConnector, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a PublicCloudConnector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-12-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. + /// Represent public cloud connectors resource. + /// Resource create parameters. + /// 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 publicCloudConnector, PublicCloudConnectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _publicCloudConnectorRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, publicCloudConnector, data, cancellationToken); + var operation = new HybridConnectivityArmOperation(new PublicCloudConnectorOperationSource(Client), _publicCloudConnectorClientDiagnostics, Pipeline, _publicCloudConnectorRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, publicCloudConnector, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a PublicCloudConnector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Represent public cloud connectors 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 publicCloudConnector, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorCollection.Get"); + scope.Start(); + try + { + var response = await _publicCloudConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, publicCloudConnector, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PublicCloudConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a PublicCloudConnector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Represent public cloud connectors resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string publicCloudConnector, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorCollection.Get"); + scope.Start(); + try + { + var response = _publicCloudConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, publicCloudConnector, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PublicCloudConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List PublicCloudConnector resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors + /// + /// + /// Operation Id + /// PublicCloudConnectors_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-12-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) => _publicCloudConnectorRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _publicCloudConnectorRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PublicCloudConnectorResource(Client, PublicCloudConnectorData.DeserializePublicCloudConnectorData(e)), _publicCloudConnectorClientDiagnostics, Pipeline, "PublicCloudConnectorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List PublicCloudConnector resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors + /// + /// + /// Operation Id + /// PublicCloudConnectors_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-12-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) => _publicCloudConnectorRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _publicCloudConnectorRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PublicCloudConnectorResource(Client, PublicCloudConnectorData.DeserializePublicCloudConnectorData(e)), _publicCloudConnectorClientDiagnostics, Pipeline, "PublicCloudConnectorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Represent public cloud connectors 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 publicCloudConnector, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorCollection.Exists"); + scope.Start(); + try + { + var response = await _publicCloudConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, publicCloudConnector, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Represent public cloud connectors resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string publicCloudConnector, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorCollection.Exists"); + scope.Start(); + try + { + var response = _publicCloudConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, publicCloudConnector, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Represent public cloud connectors 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 publicCloudConnector, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _publicCloudConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, publicCloudConnector, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new PublicCloudConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Represent public cloud connectors resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string publicCloudConnector, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorCollection.GetIfExists"); + scope.Start(); + try + { + var response = _publicCloudConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, publicCloudConnector, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new PublicCloudConnectorResource(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/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/PublicCloudConnectorData.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/PublicCloudConnectorData.Serialization.cs new file mode 100644 index 0000000000000..75c7a2b7dad68 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/PublicCloudConnectorData.Serialization.cs @@ -0,0 +1,178 @@ +// 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; +using Azure.ResourceManager.HybridConnectivity.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + public partial class PublicCloudConnectorData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PublicCloudConnectorData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + PublicCloudConnectorData 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(PublicCloudConnectorData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePublicCloudConnectorData(document.RootElement, options); + } + + internal static PublicCloudConnectorData DeserializePublicCloudConnectorData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PublicCloudConnectorProperties properties = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = 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) + { + continue; + } + properties = PublicCloudConnectorProperties.DeserializePublicCloudConnectorProperties(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PublicCloudConnectorData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + 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(PublicCloudConnectorData)} does not support writing '{options.Format}' format."); + } + } + + PublicCloudConnectorData 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 DeserializePublicCloudConnectorData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PublicCloudConnectorData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/PublicCloudConnectorData.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/PublicCloudConnectorData.cs new file mode 100644 index 0000000000000..81a1e382548ed --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/PublicCloudConnectorData.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.HybridConnectivity.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + /// + /// A class representing the PublicCloudConnector data model. + /// Public Cloud Connector + /// + public partial class PublicCloudConnectorData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public PublicCloudConnectorData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal PublicCloudConnectorData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, PublicCloudConnectorProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PublicCloudConnectorData() + { + } + + /// The resource-specific properties for this resource. + public PublicCloudConnectorProperties Properties { get; set; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/PublicCloudConnectorResource.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/PublicCloudConnectorResource.Serialization.cs new file mode 100644 index 0000000000000..d83b87210bb2b --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/PublicCloudConnectorResource.Serialization.cs @@ -0,0 +1,26 @@ +// 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.HybridConnectivity +{ + public partial class PublicCloudConnectorResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + PublicCloudConnectorData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + PublicCloudConnectorData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/PublicCloudConnectorResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/PublicCloudConnectorResource.cs new file mode 100644 index 0000000000000..909bac2b9f245 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/PublicCloudConnectorResource.cs @@ -0,0 +1,787 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridConnectivity.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.HybridConnectivity +{ + /// + /// A Class representing a PublicCloudConnector 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 GetPublicCloudConnectorResource method. + /// Otherwise you can get one from its parent resource using the GetPublicCloudConnector method. + /// + public partial class PublicCloudConnectorResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The publicCloudConnector. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string publicCloudConnector) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _publicCloudConnectorClientDiagnostics; + private readonly PublicCloudConnectorsRestOperations _publicCloudConnectorRestClient; + private readonly PublicCloudConnectorData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.HybridConnectivity/publicCloudConnectors"; + + /// Initializes a new instance of the class for mocking. + protected PublicCloudConnectorResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal PublicCloudConnectorResource(ArmClient client, PublicCloudConnectorData 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 PublicCloudConnectorResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _publicCloudConnectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridConnectivity", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string publicCloudConnectorApiVersion); + _publicCloudConnectorRestClient = new PublicCloudConnectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, publicCloudConnectorApiVersion); +#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 PublicCloudConnectorData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a PublicCloudConnector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorResource.Get"); + scope.Start(); + try + { + var response = await _publicCloudConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PublicCloudConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a PublicCloudConnector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorResource.Get"); + scope.Start(); + try + { + var response = _publicCloudConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PublicCloudConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a PublicCloudConnector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Delete + /// + /// + /// Default Api Version + /// 2024-12-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 = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorResource.Delete"); + scope.Start(); + try + { + var response = await _publicCloudConnectorRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _publicCloudConnectorRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new HybridConnectivityArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a PublicCloudConnector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Delete + /// + /// + /// Default Api Version + /// 2024-12-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 = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorResource.Delete"); + scope.Start(); + try + { + var response = _publicCloudConnectorRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var uri = _publicCloudConnectorRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new HybridConnectivityArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a PublicCloudConnector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Update + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(PublicCloudConnectorPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorResource.Update"); + scope.Start(); + try + { + var response = await _publicCloudConnectorRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new PublicCloudConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a PublicCloudConnector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Update + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual Response Update(PublicCloudConnectorPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorResource.Update"); + scope.Start(); + try + { + var response = _publicCloudConnectorRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + return Response.FromValue(new PublicCloudConnectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// A long-running resource action. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector}/testPermissions + /// + /// + /// Operation Id + /// PublicCloudConnectors_TestPermissions + /// + /// + /// Default Api Version + /// 2024-12-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> TestPermissionsAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorResource.TestPermissions"); + scope.Start(); + try + { + var response = await _publicCloudConnectorRestClient.TestPermissionsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new HybridConnectivityArmOperation(new OperationStatusResultOperationSource(), _publicCloudConnectorClientDiagnostics, Pipeline, _publicCloudConnectorRestClient.CreateTestPermissionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// A long-running resource action. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector}/testPermissions + /// + /// + /// Operation Id + /// PublicCloudConnectors_TestPermissions + /// + /// + /// Default Api Version + /// 2024-12-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 TestPermissions(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorResource.TestPermissions"); + scope.Start(); + try + { + var response = _publicCloudConnectorRestClient.TestPermissions(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new HybridConnectivityArmOperation(new OperationStatusResultOperationSource(), _publicCloudConnectorClientDiagnostics, Pipeline, _publicCloudConnectorRestClient.CreateTestPermissionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _publicCloudConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new PublicCloudConnectorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new PublicCloudConnectorPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _publicCloudConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new PublicCloudConnectorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new PublicCloudConnectorPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _publicCloudConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new PublicCloudConnectorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new PublicCloudConnectorPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _publicCloudConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new PublicCloudConnectorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new PublicCloudConnectorPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _publicCloudConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new PublicCloudConnectorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new PublicCloudConnectorPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector} + /// + /// + /// Operation Id + /// PublicCloudConnectors_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _publicCloudConnectorClientDiagnostics.CreateScope("PublicCloudConnectorResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _publicCloudConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new PublicCloudConnectorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new PublicCloudConnectorPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/EndpointsRestOperations.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/EndpointsRestOperations.cs index f4ff712c4ebb8..1a93a8c445bc9 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/EndpointsRestOperations.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/EndpointsRestOperations.cs @@ -32,7 +32,7 @@ public EndpointsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-10-06-preview"; + _apiVersion = apiVersion ?? "2024-12-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -452,7 +452,7 @@ public Response Delete(string scope, string endpointName, CancellationToken canc } } - internal RequestUriBuilder CreateListCredentialsRequestUri(string scope, string endpointName, long? expiresin) + internal RequestUriBuilder CreateListCredentialsRequestUri(string scope, string endpointName, ListCredentialsContent content, long? expiresin) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -469,7 +469,7 @@ internal RequestUriBuilder CreateListCredentialsRequestUri(string scope, string return uri; } - internal HttpMessage CreateListCredentialsRequest(string scope, string endpointName, long? expiresin) + internal HttpMessage CreateListCredentialsRequest(string scope, string endpointName, ListCredentialsContent content, long? expiresin) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -488,6 +488,13 @@ internal HttpMessage CreateListCredentialsRequest(string scope, string endpointN } request.Uri = uri; request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } _userAgent.Apply(message); return message; } @@ -495,15 +502,16 @@ internal HttpMessage CreateListCredentialsRequest(string scope, string endpointN /// Gets the endpoint access credentials to the resource. /// The fully qualified Azure Resource manager identifier of the resource to be connected. /// The endpoint name. + /// Object of type ListCredentialsRequest. /// The is how long the endpoint access token is valid (in seconds). /// The cancellation token to use. /// or is null. - public async Task> ListCredentialsAsync(string scope, string endpointName, long? expiresin = null, CancellationToken cancellationToken = default) + public async Task> ListCredentialsAsync(string scope, string endpointName, ListCredentialsContent content = null, long? expiresin = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNull(endpointName, nameof(endpointName)); - using var message = CreateListCredentialsRequest(scope, endpointName, expiresin); + using var message = CreateListCredentialsRequest(scope, endpointName, content, expiresin); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -522,15 +530,16 @@ public async Task> ListCredentialsAsync(s /// Gets the endpoint access credentials to the resource. /// The fully qualified Azure Resource manager identifier of the resource to be connected. /// The endpoint name. + /// Object of type ListCredentialsRequest. /// The is how long the endpoint access token is valid (in seconds). /// The cancellation token to use. /// or is null. - public Response ListCredentials(string scope, string endpointName, long? expiresin = null, CancellationToken cancellationToken = default) + public Response ListCredentials(string scope, string endpointName, ListCredentialsContent content = null, long? expiresin = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNull(endpointName, nameof(endpointName)); - using var message = CreateListCredentialsRequest(scope, endpointName, expiresin); + using var message = CreateListCredentialsRequest(scope, endpointName, content, expiresin); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -546,6 +555,201 @@ public Response ListCredentials(string scope, stri } } + internal RequestUriBuilder CreateListIngressGatewayCredentialsRequestUri(string scope, string endpointName, ListIngressGatewayCredentialsContent content, long? expiresin) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/endpoints/", false); + uri.AppendPath(endpointName, false); + uri.AppendPath("/listIngressGatewayCredentials", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (expiresin != null) + { + uri.AppendQuery("expiresin", expiresin.Value, true); + } + return uri; + } + + internal HttpMessage CreateListIngressGatewayCredentialsRequest(string scope, string endpointName, ListIngressGatewayCredentialsContent content, long? expiresin) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/endpoints/", false); + uri.AppendPath(endpointName, false); + uri.AppendPath("/listIngressGatewayCredentials", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (expiresin != null) + { + uri.AppendQuery("expiresin", expiresin.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Gets the ingress gateway endpoint credentials. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The endpoint name. + /// Object of type ListIngressGatewayCredentialsRequest. + /// The is how long the endpoint access token is valid (in seconds). + /// The cancellation token to use. + /// or is null. + public async Task> ListIngressGatewayCredentialsAsync(string scope, string endpointName, ListIngressGatewayCredentialsContent content = null, long? expiresin = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + + using var message = CreateListIngressGatewayCredentialsRequest(scope, endpointName, content, expiresin); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IngressGatewayAsset value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IngressGatewayAsset.DeserializeIngressGatewayAsset(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the ingress gateway endpoint credentials. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The endpoint name. + /// Object of type ListIngressGatewayCredentialsRequest. + /// The is how long the endpoint access token is valid (in seconds). + /// The cancellation token to use. + /// or is null. + public Response ListIngressGatewayCredentials(string scope, string endpointName, ListIngressGatewayCredentialsContent content = null, long? expiresin = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + + using var message = CreateListIngressGatewayCredentialsRequest(scope, endpointName, content, expiresin); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IngressGatewayAsset value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IngressGatewayAsset.DeserializeIngressGatewayAsset(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListManagedProxyDetailsRequestUri(string scope, string endpointName, ManagedProxyContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/endpoints/", false); + uri.AppendPath(endpointName, false); + uri.AppendPath("/listManagedProxyDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListManagedProxyDetailsRequest(string scope, string endpointName, ManagedProxyContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/endpoints/", false); + uri.AppendPath(endpointName, false); + uri.AppendPath("/listManagedProxyDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Fetches the managed proxy details. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The endpoint name. + /// Object of type ManagedProxyRequest. + /// The cancellation token to use. + /// , or is null. + public async Task> ListManagedProxyDetailsAsync(string scope, string endpointName, ManagedProxyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateListManagedProxyDetailsRequest(scope, endpointName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ManagedProxyAsset value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ManagedProxyAsset.DeserializeManagedProxyAsset(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Fetches the managed proxy details. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The endpoint name. + /// Object of type ManagedProxyRequest. + /// The cancellation token to use. + /// , or is null. + public Response ListManagedProxyDetails(string scope, string endpointName, ManagedProxyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateListManagedProxyDetailsRequest(scope, endpointName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ManagedProxyAsset value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ManagedProxyAsset.DeserializeManagedProxyAsset(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string scope) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/GenerateAwsTemplateRestOperations.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/GenerateAwsTemplateRestOperations.cs new file mode 100644 index 0000000000000..85e3182d62144 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/GenerateAwsTemplateRestOperations.cs @@ -0,0 +1,122 @@ +// 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; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridConnectivity.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + internal partial class GenerateAwsTemplateRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of GenerateAwsTemplateRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public GenerateAwsTemplateRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-12-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreatePostRequestUri(string subscriptionId, GenerateAwsTemplateContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/generateAwsTemplate", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePostRequest(string subscriptionId, GenerateAwsTemplateContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/generateAwsTemplate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Retrieve AWS Cloud Formation template. + /// The ID of the target subscription. The value must be an UUID. + /// ConnectorId and SolutionTypes and their properties to Generate AWS CFT Template. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> PostAsync(string subscriptionId, GenerateAwsTemplateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreatePostRequest(subscriptionId, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BinaryData value = default; + value = await BinaryData.FromStreamAsync(message.Response.ContentStream).ConfigureAwait(false); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieve AWS Cloud Formation template. + /// The ID of the target subscription. The value must be an UUID. + /// ConnectorId and SolutionTypes and their properties to Generate AWS CFT Template. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response Post(string subscriptionId, GenerateAwsTemplateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreatePostRequest(subscriptionId, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BinaryData value = default; + value = BinaryData.FromStream(message.Response.ContentStream); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/InventoryRestOperations.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/InventoryRestOperations.cs new file mode 100644 index 0000000000000..b72de2f3ece7d --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/InventoryRestOperations.cs @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridConnectivity.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + internal partial class InventoryRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of InventoryRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public InventoryRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-12-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySolutionConfigurationRequestUri(string resourceUri, string solutionConfiguration) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/solutionConfigurations/", false); + uri.AppendPath(solutionConfiguration, true); + uri.AppendPath("/inventory", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySolutionConfigurationRequest(string resourceUri, string solutionConfiguration) + { + 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.HybridConnectivity/solutionConfigurations/", false); + uri.AppendPath(solutionConfiguration, true); + uri.AppendPath("/inventory", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List InventoryResource resources by SolutionConfiguration. + /// The fully qualified Azure Resource manager identifier of the resource. + /// Represent Solution Configuration Resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySolutionConfigurationAsync(string resourceUri, string solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + + using var message = CreateListBySolutionConfigurationRequest(resourceUri, solutionConfiguration); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InventoryResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InventoryResourceListResult.DeserializeInventoryResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List InventoryResource resources by SolutionConfiguration. + /// The fully qualified Azure Resource manager identifier of the resource. + /// Represent Solution Configuration Resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySolutionConfiguration(string resourceUri, string solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + + using var message = CreateListBySolutionConfigurationRequest(resourceUri, solutionConfiguration); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InventoryResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InventoryResourceListResult.DeserializeInventoryResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string resourceUri, string solutionConfiguration, string inventoryId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/solutionConfigurations/", false); + uri.AppendPath(solutionConfiguration, true); + uri.AppendPath("/inventory/", false); + uri.AppendPath(inventoryId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string resourceUri, string solutionConfiguration, string inventoryId) + { + 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.HybridConnectivity/solutionConfigurations/", false); + uri.AppendPath(solutionConfiguration, true); + uri.AppendPath("/inventory/", false); + uri.AppendPath(inventoryId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a InventoryResource. + /// The fully qualified Azure Resource manager identifier of the resource. + /// Represent Solution Configuration Resource. + /// Inventory resource. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string resourceUri, string solutionConfiguration, string inventoryId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + Argument.AssertNotNullOrEmpty(inventoryId, nameof(inventoryId)); + + using var message = CreateGetRequest(resourceUri, solutionConfiguration, inventoryId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridConnectivityInventoryResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridConnectivityInventoryResourceData.DeserializeHybridConnectivityInventoryResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((HybridConnectivityInventoryResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a InventoryResource. + /// The fully qualified Azure Resource manager identifier of the resource. + /// Represent Solution Configuration Resource. + /// Inventory resource. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Get(string resourceUri, string solutionConfiguration, string inventoryId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + Argument.AssertNotNullOrEmpty(inventoryId, nameof(inventoryId)); + + using var message = CreateGetRequest(resourceUri, solutionConfiguration, inventoryId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridConnectivityInventoryResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridConnectivityInventoryResourceData.DeserializeHybridConnectivityInventoryResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((HybridConnectivityInventoryResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySolutionConfigurationNextPageRequestUri(string nextLink, string resourceUri, string solutionConfiguration) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySolutionConfigurationNextPageRequest(string nextLink, string resourceUri, string solutionConfiguration) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List InventoryResource resources by SolutionConfiguration. + /// The URL to the next page of results. + /// The fully qualified Azure Resource manager identifier of the resource. + /// Represent Solution Configuration Resource. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySolutionConfigurationNextPageAsync(string nextLink, string resourceUri, string solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + + using var message = CreateListBySolutionConfigurationNextPageRequest(nextLink, resourceUri, solutionConfiguration); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InventoryResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InventoryResourceListResult.DeserializeInventoryResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List InventoryResource resources by SolutionConfiguration. + /// The URL to the next page of results. + /// The fully qualified Azure Resource manager identifier of the resource. + /// Represent Solution Configuration Resource. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySolutionConfigurationNextPage(string nextLink, string resourceUri, string solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + + using var message = CreateListBySolutionConfigurationNextPageRequest(nextLink, resourceUri, solutionConfiguration); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InventoryResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InventoryResourceListResult.DeserializeInventoryResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/PublicCloudConnectorsRestOperations.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/PublicCloudConnectorsRestOperations.cs new file mode 100644 index 0000000000000..d71090263f179 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/PublicCloudConnectorsRestOperations.cs @@ -0,0 +1,817 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridConnectivity.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + internal partial class PublicCloudConnectorsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PublicCloudConnectorsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public PublicCloudConnectorsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-12-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/publicCloudConnectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/publicCloudConnectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List PublicCloudConnector resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PublicCloudConnectorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PublicCloudConnectorListResult.DeserializePublicCloudConnectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List PublicCloudConnector resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PublicCloudConnectorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PublicCloudConnectorListResult.DeserializePublicCloudConnectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/publicCloudConnectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/publicCloudConnectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List PublicCloudConnector resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PublicCloudConnectorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PublicCloudConnectorListResult.DeserializePublicCloudConnectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List PublicCloudConnector resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PublicCloudConnectorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PublicCloudConnectorListResult.DeserializePublicCloudConnectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string publicCloudConnector) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/publicCloudConnectors/", false); + uri.AppendPath(publicCloudConnector, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string publicCloudConnector) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/publicCloudConnectors/", false); + uri.AppendPath(publicCloudConnector, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a PublicCloudConnector. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Represent public cloud connectors resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string publicCloudConnector, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, publicCloudConnector); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PublicCloudConnectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PublicCloudConnectorData.DeserializePublicCloudConnectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PublicCloudConnectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a PublicCloudConnector. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Represent public cloud connectors resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string publicCloudConnector, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, publicCloudConnector); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PublicCloudConnectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PublicCloudConnectorData.DeserializePublicCloudConnectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PublicCloudConnectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string publicCloudConnector, PublicCloudConnectorData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/publicCloudConnectors/", false); + uri.AppendPath(publicCloudConnector, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string publicCloudConnector, PublicCloudConnectorData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/publicCloudConnectors/", false); + uri.AppendPath(publicCloudConnector, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a PublicCloudConnector. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Represent public cloud connectors resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string publicCloudConnector, PublicCloudConnectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, publicCloudConnector, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a PublicCloudConnector. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Represent public cloud connectors resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string publicCloudConnector, PublicCloudConnectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, publicCloudConnector, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string publicCloudConnector, PublicCloudConnectorPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/publicCloudConnectors/", false); + uri.AppendPath(publicCloudConnector, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string publicCloudConnector, PublicCloudConnectorPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/publicCloudConnectors/", false); + uri.AppendPath(publicCloudConnector, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a PublicCloudConnector. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Represent public cloud connectors resource. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string publicCloudConnector, PublicCloudConnectorPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, publicCloudConnector, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PublicCloudConnectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PublicCloudConnectorData.DeserializePublicCloudConnectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a PublicCloudConnector. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Represent public cloud connectors resource. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string publicCloudConnector, PublicCloudConnectorPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, publicCloudConnector, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PublicCloudConnectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PublicCloudConnectorData.DeserializePublicCloudConnectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string publicCloudConnector) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/publicCloudConnectors/", false); + uri.AppendPath(publicCloudConnector, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string publicCloudConnector) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/publicCloudConnectors/", false); + uri.AppendPath(publicCloudConnector, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a PublicCloudConnector. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Represent public cloud connectors resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string publicCloudConnector, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, publicCloudConnector); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a PublicCloudConnector. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Represent public cloud connectors resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string publicCloudConnector, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, publicCloudConnector); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateTestPermissionsRequestUri(string subscriptionId, string resourceGroupName, string publicCloudConnector) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/publicCloudConnectors/", false); + uri.AppendPath(publicCloudConnector, true); + uri.AppendPath("/testPermissions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateTestPermissionsRequest(string subscriptionId, string resourceGroupName, string publicCloudConnector) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/publicCloudConnectors/", false); + uri.AppendPath(publicCloudConnector, true); + uri.AppendPath("/testPermissions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// A long-running resource action. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Represent public cloud connectors resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task TestPermissionsAsync(string subscriptionId, string resourceGroupName, string publicCloudConnector, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + + using var message = CreateTestPermissionsRequest(subscriptionId, resourceGroupName, publicCloudConnector); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// A long-running resource action. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Represent public cloud connectors resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response TestPermissions(string subscriptionId, string resourceGroupName, string publicCloudConnector, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(publicCloudConnector, nameof(publicCloudConnector)); + + using var message = CreateTestPermissionsRequest(subscriptionId, resourceGroupName, publicCloudConnector); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List PublicCloudConnector resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PublicCloudConnectorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PublicCloudConnectorListResult.DeserializePublicCloudConnectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List PublicCloudConnector resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PublicCloudConnectorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PublicCloudConnectorListResult.DeserializePublicCloudConnectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List PublicCloudConnector resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PublicCloudConnectorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PublicCloudConnectorListResult.DeserializePublicCloudConnectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List PublicCloudConnector resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PublicCloudConnectorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PublicCloudConnectorListResult.DeserializePublicCloudConnectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/ServiceConfigurationsRestOperations.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/ServiceConfigurationsRestOperations.cs new file mode 100644 index 0000000000000..40bac437d63ee --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/ServiceConfigurationsRestOperations.cs @@ -0,0 +1,575 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridConnectivity.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + internal partial class ServiceConfigurationsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ServiceConfigurationsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ServiceConfigurationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-12-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByEndpointResourceRequestUri(string scope, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/endpoints/", false); + uri.AppendPath(endpointName, false); + uri.AppendPath("/serviceConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByEndpointResourceRequest(string scope, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/endpoints/", false); + uri.AppendPath(endpointName, false); + uri.AppendPath("/serviceConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// API to enumerate registered services in service configurations under a Endpoint Resource. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The endpoint name. + /// The cancellation token to use. + /// or is null. + public async Task> ListByEndpointResourceAsync(string scope, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + + using var message = CreateListByEndpointResourceRequest(scope, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ServiceConfigurationList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ServiceConfigurationList.DeserializeServiceConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// API to enumerate registered services in service configurations under a Endpoint Resource. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The endpoint name. + /// The cancellation token to use. + /// or is null. + public Response ListByEndpointResource(string scope, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + + using var message = CreateListByEndpointResourceRequest(scope, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ServiceConfigurationList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ServiceConfigurationList.DeserializeServiceConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string scope, string endpointName, string serviceConfigurationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/endpoints/", false); + uri.AppendPath(endpointName, false); + uri.AppendPath("/serviceConfigurations/", false); + uri.AppendPath(serviceConfigurationName, false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string scope, string endpointName, string serviceConfigurationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/endpoints/", false); + uri.AppendPath(endpointName, false); + uri.AppendPath("/serviceConfigurations/", false); + uri.AppendPath(serviceConfigurationName, false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details about the service to the resource. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The endpoint name. + /// The service name. + /// The cancellation token to use. + /// , or is null. + public async Task> GetAsync(string scope, string endpointName, string serviceConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + Argument.AssertNotNull(serviceConfigurationName, nameof(serviceConfigurationName)); + + using var message = CreateGetRequest(scope, endpointName, serviceConfigurationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ServiceConfigurationResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ServiceConfigurationResourceData.DeserializeServiceConfigurationResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ServiceConfigurationResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details about the service to the resource. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The endpoint name. + /// The service name. + /// The cancellation token to use. + /// , or is null. + public Response Get(string scope, string endpointName, string serviceConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + Argument.AssertNotNull(serviceConfigurationName, nameof(serviceConfigurationName)); + + using var message = CreateGetRequest(scope, endpointName, serviceConfigurationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ServiceConfigurationResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ServiceConfigurationResourceData.DeserializeServiceConfigurationResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ServiceConfigurationResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrupdateRequestUri(string scope, string endpointName, string serviceConfigurationName, ServiceConfigurationResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/endpoints/", false); + uri.AppendPath(endpointName, false); + uri.AppendPath("/serviceConfigurations/", false); + uri.AppendPath(serviceConfigurationName, false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrupdateRequest(string scope, string endpointName, string serviceConfigurationName, ServiceConfigurationResourceData 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(scope, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/endpoints/", false); + uri.AppendPath(endpointName, false); + uri.AppendPath("/serviceConfigurations/", false); + uri.AppendPath(serviceConfigurationName, false); + 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 a service in serviceConfiguration for the endpoint resource. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The endpoint name. + /// The service name. + /// Service details. + /// The cancellation token to use. + /// , , or is null. + public async Task> CreateOrupdateAsync(string scope, string endpointName, string serviceConfigurationName, ServiceConfigurationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + Argument.AssertNotNull(serviceConfigurationName, nameof(serviceConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrupdateRequest(scope, endpointName, serviceConfigurationName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + ServiceConfigurationResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ServiceConfigurationResourceData.DeserializeServiceConfigurationResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update a service in serviceConfiguration for the endpoint resource. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The endpoint name. + /// The service name. + /// Service details. + /// The cancellation token to use. + /// , , or is null. + public Response CreateOrupdate(string scope, string endpointName, string serviceConfigurationName, ServiceConfigurationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + Argument.AssertNotNull(serviceConfigurationName, nameof(serviceConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrupdateRequest(scope, endpointName, serviceConfigurationName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + ServiceConfigurationResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ServiceConfigurationResourceData.DeserializeServiceConfigurationResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string scope, string endpointName, string serviceConfigurationName, ServiceConfigurationResourcePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/endpoints/", false); + uri.AppendPath(endpointName, false); + uri.AppendPath("/serviceConfigurations/", false); + uri.AppendPath(serviceConfigurationName, false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string scope, string endpointName, string serviceConfigurationName, ServiceConfigurationResourcePatch 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(scope, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/endpoints/", false); + uri.AppendPath(endpointName, false); + uri.AppendPath("/serviceConfigurations/", false); + uri.AppendPath(serviceConfigurationName, false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the service details in the service configurations of the target resource. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The endpoint name. + /// The service name. + /// Service details. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateAsync(string scope, string endpointName, string serviceConfigurationName, ServiceConfigurationResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + Argument.AssertNotNull(serviceConfigurationName, nameof(serviceConfigurationName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(scope, endpointName, serviceConfigurationName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ServiceConfigurationResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ServiceConfigurationResourceData.DeserializeServiceConfigurationResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the service details in the service configurations of the target resource. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The endpoint name. + /// The service name. + /// Service details. + /// The cancellation token to use. + /// , , or is null. + public Response Update(string scope, string endpointName, string serviceConfigurationName, ServiceConfigurationResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + Argument.AssertNotNull(serviceConfigurationName, nameof(serviceConfigurationName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(scope, endpointName, serviceConfigurationName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ServiceConfigurationResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ServiceConfigurationResourceData.DeserializeServiceConfigurationResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string scope, string endpointName, string serviceConfigurationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/endpoints/", false); + uri.AppendPath(endpointName, false); + uri.AppendPath("/serviceConfigurations/", false); + uri.AppendPath(serviceConfigurationName, false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string scope, string endpointName, string serviceConfigurationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/endpoints/", false); + uri.AppendPath(endpointName, false); + uri.AppendPath("/serviceConfigurations/", false); + uri.AppendPath(serviceConfigurationName, false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the service details to the target resource. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The endpoint name. + /// The service name. + /// The cancellation token to use. + /// , or is null. + public async Task DeleteAsync(string scope, string endpointName, string serviceConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + Argument.AssertNotNull(serviceConfigurationName, nameof(serviceConfigurationName)); + + using var message = CreateDeleteRequest(scope, endpointName, serviceConfigurationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the service details to the target resource. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The endpoint name. + /// The service name. + /// The cancellation token to use. + /// , or is null. + public Response Delete(string scope, string endpointName, string serviceConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + Argument.AssertNotNull(serviceConfigurationName, nameof(serviceConfigurationName)); + + using var message = CreateDeleteRequest(scope, endpointName, serviceConfigurationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByEndpointResourceNextPageRequestUri(string nextLink, string scope, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByEndpointResourceNextPageRequest(string nextLink, string scope, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// API to enumerate registered services in service configurations under a Endpoint Resource. + /// The URL to the next page of results. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The endpoint name. + /// The cancellation token to use. + /// , or is null. + public async Task> ListByEndpointResourceNextPageAsync(string nextLink, string scope, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + + using var message = CreateListByEndpointResourceNextPageRequest(nextLink, scope, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ServiceConfigurationList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ServiceConfigurationList.DeserializeServiceConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// API to enumerate registered services in service configurations under a Endpoint Resource. + /// The URL to the next page of results. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The endpoint name. + /// The cancellation token to use. + /// , or is null. + public Response ListByEndpointResourceNextPage(string nextLink, string scope, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + + using var message = CreateListByEndpointResourceNextPageRequest(nextLink, scope, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ServiceConfigurationList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ServiceConfigurationList.DeserializeServiceConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/SolutionConfigurationsRestOperations.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/SolutionConfigurationsRestOperations.cs new file mode 100644 index 0000000000000..e84bc53bd5ba0 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/SolutionConfigurationsRestOperations.cs @@ -0,0 +1,617 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridConnectivity.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + internal partial class SolutionConfigurationsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SolutionConfigurationsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public SolutionConfigurationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-12-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/solutionConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string resourceUri) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/solutionConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SolutionConfiguration resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public async Task> ListAsync(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SolutionConfigurationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SolutionConfigurationListResult.DeserializeSolutionConfigurationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SolutionConfiguration resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public Response List(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SolutionConfigurationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SolutionConfigurationListResult.DeserializeSolutionConfigurationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string resourceUri, string solutionConfiguration) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/solutionConfigurations/", false); + uri.AppendPath(solutionConfiguration, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string resourceUri, string solutionConfiguration) + { + 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.HybridConnectivity/solutionConfigurations/", false); + uri.AppendPath(solutionConfiguration, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a SolutionConfiguration. + /// The fully qualified Azure Resource manager identifier of the resource. + /// Represent Solution Configuration 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 solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + + using var message = CreateGetRequest(resourceUri, solutionConfiguration); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SolutionConfigurationData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SolutionConfigurationData.DeserializeSolutionConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SolutionConfigurationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a SolutionConfiguration. + /// The fully qualified Azure Resource manager identifier of the resource. + /// Represent Solution Configuration 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 solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + + using var message = CreateGetRequest(resourceUri, solutionConfiguration); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SolutionConfigurationData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SolutionConfigurationData.DeserializeSolutionConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SolutionConfigurationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, string solutionConfiguration, SolutionConfigurationData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/solutionConfigurations/", false); + uri.AppendPath(solutionConfiguration, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string solutionConfiguration, SolutionConfigurationData 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.HybridConnectivity/solutionConfigurations/", false); + uri.AppendPath(solutionConfiguration, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a SolutionConfiguration. + /// The fully qualified Azure Resource manager identifier of the resource. + /// Represent Solution Configuration Resource. + /// Resource create parameters. + /// 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 solutionConfiguration, SolutionConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(resourceUri, solutionConfiguration, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + SolutionConfigurationData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SolutionConfigurationData.DeserializeSolutionConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a SolutionConfiguration. + /// The fully qualified Azure Resource manager identifier of the resource. + /// Represent Solution Configuration Resource. + /// Resource create parameters. + /// 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 solutionConfiguration, SolutionConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(resourceUri, solutionConfiguration, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + SolutionConfigurationData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SolutionConfigurationData.DeserializeSolutionConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string resourceUri, string solutionConfiguration, SolutionConfigurationPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/solutionConfigurations/", false); + uri.AppendPath(solutionConfiguration, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string resourceUri, string solutionConfiguration, SolutionConfigurationPatch 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.HybridConnectivity/solutionConfigurations/", false); + uri.AppendPath(solutionConfiguration, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a SolutionConfiguration. + /// The fully qualified Azure Resource manager identifier of the resource. + /// Represent Solution Configuration Resource. + /// The resource properties to be updated. + /// 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 solutionConfiguration, SolutionConfigurationPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(resourceUri, solutionConfiguration, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SolutionConfigurationData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SolutionConfigurationData.DeserializeSolutionConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a SolutionConfiguration. + /// The fully qualified Azure Resource manager identifier of the resource. + /// Represent Solution Configuration Resource. + /// The resource properties to be updated. + /// 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 solutionConfiguration, SolutionConfigurationPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(resourceUri, solutionConfiguration, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SolutionConfigurationData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SolutionConfigurationData.DeserializeSolutionConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string resourceUri, string solutionConfiguration) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/solutionConfigurations/", false); + uri.AppendPath(solutionConfiguration, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string resourceUri, string solutionConfiguration) + { + 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.HybridConnectivity/solutionConfigurations/", false); + uri.AppendPath(solutionConfiguration, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a SolutionConfiguration. + /// The fully qualified Azure Resource manager identifier of the resource. + /// Represent Solution Configuration 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 solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + + using var message = CreateDeleteRequest(resourceUri, solutionConfiguration); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a SolutionConfiguration. + /// The fully qualified Azure Resource manager identifier of the resource. + /// Represent Solution Configuration 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 solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + + using var message = CreateDeleteRequest(resourceUri, solutionConfiguration); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateSyncNowRequestUri(string resourceUri, string solutionConfiguration) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/solutionConfigurations/", false); + uri.AppendPath(solutionConfiguration, true); + uri.AppendPath("/syncNow", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateSyncNowRequest(string resourceUri, string solutionConfiguration) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/solutionConfigurations/", false); + uri.AppendPath(solutionConfiguration, true); + uri.AppendPath("/syncNow", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Trigger immediate sync with source cloud. + /// The fully qualified Azure Resource manager identifier of the resource. + /// Represent Solution Configuration Resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task SyncNowAsync(string resourceUri, string solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + + using var message = CreateSyncNowRequest(resourceUri, solutionConfiguration); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Trigger immediate sync with source cloud. + /// The fully qualified Azure Resource manager identifier of the resource. + /// Represent Solution Configuration Resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response SyncNow(string resourceUri, string solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + + using var message = CreateSyncNowRequest(resourceUri, solutionConfiguration); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceUri) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SolutionConfiguration resources by parent. + /// The URL to the next page of results. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// or is null. + public async Task> ListNextPageAsync(string nextLink, string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListNextPageRequest(nextLink, resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SolutionConfigurationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SolutionConfigurationListResult.DeserializeSolutionConfigurationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SolutionConfiguration resources by parent. + /// The URL to the next page of results. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// or is null. + public Response ListNextPage(string nextLink, string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListNextPageRequest(nextLink, resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SolutionConfigurationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SolutionConfigurationListResult.DeserializeSolutionConfigurationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/SolutionTypesRestOperations.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/SolutionTypesRestOperations.cs new file mode 100644 index 0000000000000..67866a05c5757 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/SolutionTypesRestOperations.cs @@ -0,0 +1,455 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridConnectivity.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + internal partial class SolutionTypesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SolutionTypesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public SolutionTypesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-12-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/solutionTypes", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/solutionTypes", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SolutionTypeResource resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SolutionTypeResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SolutionTypeResourceListResult.DeserializeSolutionTypeResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SolutionTypeResource resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SolutionTypeResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SolutionTypeResourceListResult.DeserializeSolutionTypeResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/solutionTypes", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/solutionTypes", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SolutionTypeResource resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SolutionTypeResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SolutionTypeResourceListResult.DeserializeSolutionTypeResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SolutionTypeResource resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SolutionTypeResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SolutionTypeResourceListResult.DeserializeSolutionTypeResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string solutionType) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/solutionTypes/", false); + uri.AppendPath(solutionType, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string solutionType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridConnectivity/solutionTypes/", false); + uri.AppendPath(solutionType, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a SolutionTypeResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Solution Type resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string solutionType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(solutionType, nameof(solutionType)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, solutionType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SolutionTypeResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SolutionTypeResourceData.DeserializeSolutionTypeResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SolutionTypeResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a SolutionTypeResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Solution Type resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string solutionType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(solutionType, nameof(solutionType)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, solutionType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SolutionTypeResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SolutionTypeResourceData.DeserializeSolutionTypeResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SolutionTypeResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SolutionTypeResource resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SolutionTypeResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SolutionTypeResourceListResult.DeserializeSolutionTypeResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SolutionTypeResource resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SolutionTypeResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SolutionTypeResourceListResult.DeserializeSolutionTypeResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SolutionTypeResource resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SolutionTypeResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SolutionTypeResourceListResult.DeserializeSolutionTypeResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SolutionTypeResource resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SolutionTypeResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SolutionTypeResourceListResult.DeserializeSolutionTypeResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ServiceConfigurationResource.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ServiceConfigurationResource.Serialization.cs new file mode 100644 index 0000000000000..bfe7319b039fc --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ServiceConfigurationResource.Serialization.cs @@ -0,0 +1,26 @@ +// 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.HybridConnectivity +{ + public partial class ServiceConfigurationResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ServiceConfigurationResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ServiceConfigurationResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ServiceConfigurationResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ServiceConfigurationResource.cs new file mode 100644 index 0000000000000..ffe2df2957c13 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ServiceConfigurationResource.cs @@ -0,0 +1,343 @@ +// 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.HybridConnectivity.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + /// + /// A Class representing a ServiceConfigurationResource 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 GetServiceConfigurationResource method. + /// Otherwise you can get one from its parent resource using the GetServiceConfigurationResource method. + /// + public partial class ServiceConfigurationResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The scope. + /// The endpointName. + /// The serviceConfigurationName. + public static ResourceIdentifier CreateResourceIdentifier(string scope, string endpointName, string serviceConfigurationName) + { + var resourceId = $"{scope}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _serviceConfigurationResourceServiceConfigurationsClientDiagnostics; + private readonly ServiceConfigurationsRestOperations _serviceConfigurationResourceServiceConfigurationsRestClient; + private readonly ServiceConfigurationResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.HybridConnectivity/endpoints/serviceConfigurations"; + + /// Initializes a new instance of the class for mocking. + protected ServiceConfigurationResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ServiceConfigurationResource(ArmClient client, ServiceConfigurationResourceData 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 ServiceConfigurationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _serviceConfigurationResourceServiceConfigurationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridConnectivity", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string serviceConfigurationResourceServiceConfigurationsApiVersion); + _serviceConfigurationResourceServiceConfigurationsRestClient = new ServiceConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serviceConfigurationResourceServiceConfigurationsApiVersion); +#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 ServiceConfigurationResourceData 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)); + } + + /// + /// Gets the details about the service to the resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName} + /// + /// + /// Operation Id + /// ServiceConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _serviceConfigurationResourceServiceConfigurationsClientDiagnostics.CreateScope("ServiceConfigurationResource.Get"); + scope.Start(); + try + { + var response = await _serviceConfigurationResourceServiceConfigurationsRestClient.GetAsync(Id.Parent.Parent, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details about the service to the resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName} + /// + /// + /// Operation Id + /// ServiceConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _serviceConfigurationResourceServiceConfigurationsClientDiagnostics.CreateScope("ServiceConfigurationResource.Get"); + scope.Start(); + try + { + var response = _serviceConfigurationResourceServiceConfigurationsRestClient.Get(Id.Parent.Parent, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the service details to the target resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName} + /// + /// + /// Operation Id + /// ServiceConfigurations_Delete + /// + /// + /// Default Api Version + /// 2024-12-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 = _serviceConfigurationResourceServiceConfigurationsClientDiagnostics.CreateScope("ServiceConfigurationResource.Delete"); + scope.Start(); + try + { + var response = await _serviceConfigurationResourceServiceConfigurationsRestClient.DeleteAsync(Id.Parent.Parent, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _serviceConfigurationResourceServiceConfigurationsRestClient.CreateDeleteRequestUri(Id.Parent.Parent, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new HybridConnectivityArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the service details to the target resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName} + /// + /// + /// Operation Id + /// ServiceConfigurations_Delete + /// + /// + /// Default Api Version + /// 2024-12-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 = _serviceConfigurationResourceServiceConfigurationsClientDiagnostics.CreateScope("ServiceConfigurationResource.Delete"); + scope.Start(); + try + { + var response = _serviceConfigurationResourceServiceConfigurationsRestClient.Delete(Id.Parent.Parent, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _serviceConfigurationResourceServiceConfigurationsRestClient.CreateDeleteRequestUri(Id.Parent.Parent, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new HybridConnectivityArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the service details in the service configurations of the target resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName} + /// + /// + /// Operation Id + /// ServiceConfigurations_Update + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Service details. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(ServiceConfigurationResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _serviceConfigurationResourceServiceConfigurationsClientDiagnostics.CreateScope("ServiceConfigurationResource.Update"); + scope.Start(); + try + { + var response = await _serviceConfigurationResourceServiceConfigurationsRestClient.UpdateAsync(Id.Parent.Parent, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ServiceConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the service details in the service configurations of the target resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName} + /// + /// + /// Operation Id + /// ServiceConfigurations_Update + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Service details. + /// The cancellation token to use. + /// is null. + public virtual Response Update(ServiceConfigurationResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _serviceConfigurationResourceServiceConfigurationsClientDiagnostics.CreateScope("ServiceConfigurationResource.Update"); + scope.Start(); + try + { + var response = _serviceConfigurationResourceServiceConfigurationsRestClient.Update(Id.Parent.Parent, Id.Parent.Name, Id.Name, patch, cancellationToken); + return Response.FromValue(new ServiceConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ServiceConfigurationResourceCollection.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ServiceConfigurationResourceCollection.cs new file mode 100644 index 0000000000000..97c227bf29902 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ServiceConfigurationResourceCollection.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.HybridConnectivity +{ + /// + /// 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 GetServiceConfigurationResources method from an instance of . + /// + public partial class ServiceConfigurationResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _serviceConfigurationResourceServiceConfigurationsClientDiagnostics; + private readonly ServiceConfigurationsRestOperations _serviceConfigurationResourceServiceConfigurationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected ServiceConfigurationResourceCollection() + { + } + + /// 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 ServiceConfigurationResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _serviceConfigurationResourceServiceConfigurationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridConnectivity", ServiceConfigurationResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ServiceConfigurationResource.ResourceType, out string serviceConfigurationResourceServiceConfigurationsApiVersion); + _serviceConfigurationResourceServiceConfigurationsRestClient = new ServiceConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serviceConfigurationResourceServiceConfigurationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != EndpointResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, EndpointResource.ResourceType), nameof(id)); + } + + /// + /// Create or update a service in serviceConfiguration for the endpoint resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName} + /// + /// + /// Operation Id + /// ServiceConfigurations_CreateOrupdate + /// + /// + /// Default Api Version + /// 2024-12-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 service name. + /// Service details. + /// The cancellation token to use. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string serviceConfigurationName, ServiceConfigurationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(serviceConfigurationName, nameof(serviceConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serviceConfigurationResourceServiceConfigurationsClientDiagnostics.CreateScope("ServiceConfigurationResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _serviceConfigurationResourceServiceConfigurationsRestClient.CreateOrupdateAsync(Id.Parent, Id.Name, serviceConfigurationName, data, cancellationToken).ConfigureAwait(false); + var uri = _serviceConfigurationResourceServiceConfigurationsRestClient.CreateCreateOrupdateRequestUri(Id.Parent, Id.Name, serviceConfigurationName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new HybridConnectivityArmOperation(Response.FromValue(new ServiceConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a service in serviceConfiguration for the endpoint resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName} + /// + /// + /// Operation Id + /// ServiceConfigurations_CreateOrupdate + /// + /// + /// Default Api Version + /// 2024-12-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 service name. + /// Service details. + /// The cancellation token to use. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string serviceConfigurationName, ServiceConfigurationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(serviceConfigurationName, nameof(serviceConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serviceConfigurationResourceServiceConfigurationsClientDiagnostics.CreateScope("ServiceConfigurationResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _serviceConfigurationResourceServiceConfigurationsRestClient.CreateOrupdate(Id.Parent, Id.Name, serviceConfigurationName, data, cancellationToken); + var uri = _serviceConfigurationResourceServiceConfigurationsRestClient.CreateCreateOrupdateRequestUri(Id.Parent, Id.Name, serviceConfigurationName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new HybridConnectivityArmOperation(Response.FromValue(new ServiceConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details about the service to the resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName} + /// + /// + /// Operation Id + /// ServiceConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The service name. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetAsync(string serviceConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(serviceConfigurationName, nameof(serviceConfigurationName)); + + using var scope = _serviceConfigurationResourceServiceConfigurationsClientDiagnostics.CreateScope("ServiceConfigurationResourceCollection.Get"); + scope.Start(); + try + { + var response = await _serviceConfigurationResourceServiceConfigurationsRestClient.GetAsync(Id.Parent, Id.Name, serviceConfigurationName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details about the service to the resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName} + /// + /// + /// Operation Id + /// ServiceConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The service name. + /// The cancellation token to use. + /// is null. + public virtual Response Get(string serviceConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(serviceConfigurationName, nameof(serviceConfigurationName)); + + using var scope = _serviceConfigurationResourceServiceConfigurationsClientDiagnostics.CreateScope("ServiceConfigurationResourceCollection.Get"); + scope.Start(); + try + { + var response = _serviceConfigurationResourceServiceConfigurationsRestClient.Get(Id.Parent, Id.Name, serviceConfigurationName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// API to enumerate registered services in service configurations under a Endpoint Resource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations + /// + /// + /// Operation Id + /// ServiceConfigurations_ListByEndpointResource + /// + /// + /// Default Api Version + /// 2024-12-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) => _serviceConfigurationResourceServiceConfigurationsRestClient.CreateListByEndpointResourceRequest(Id.Parent, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serviceConfigurationResourceServiceConfigurationsRestClient.CreateListByEndpointResourceNextPageRequest(nextLink, Id.Parent, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ServiceConfigurationResource(Client, ServiceConfigurationResourceData.DeserializeServiceConfigurationResourceData(e)), _serviceConfigurationResourceServiceConfigurationsClientDiagnostics, Pipeline, "ServiceConfigurationResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// API to enumerate registered services in service configurations under a Endpoint Resource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations + /// + /// + /// Operation Id + /// ServiceConfigurations_ListByEndpointResource + /// + /// + /// Default Api Version + /// 2024-12-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) => _serviceConfigurationResourceServiceConfigurationsRestClient.CreateListByEndpointResourceRequest(Id.Parent, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serviceConfigurationResourceServiceConfigurationsRestClient.CreateListByEndpointResourceNextPageRequest(nextLink, Id.Parent, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ServiceConfigurationResource(Client, ServiceConfigurationResourceData.DeserializeServiceConfigurationResourceData(e)), _serviceConfigurationResourceServiceConfigurationsClientDiagnostics, Pipeline, "ServiceConfigurationResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName} + /// + /// + /// Operation Id + /// ServiceConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The service name. + /// The cancellation token to use. + /// is null. + public virtual async Task> ExistsAsync(string serviceConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(serviceConfigurationName, nameof(serviceConfigurationName)); + + using var scope = _serviceConfigurationResourceServiceConfigurationsClientDiagnostics.CreateScope("ServiceConfigurationResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _serviceConfigurationResourceServiceConfigurationsRestClient.GetAsync(Id.Parent, Id.Name, serviceConfigurationName, 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.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName} + /// + /// + /// Operation Id + /// ServiceConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The service name. + /// The cancellation token to use. + /// is null. + public virtual Response Exists(string serviceConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(serviceConfigurationName, nameof(serviceConfigurationName)); + + using var scope = _serviceConfigurationResourceServiceConfigurationsClientDiagnostics.CreateScope("ServiceConfigurationResourceCollection.Exists"); + scope.Start(); + try + { + var response = _serviceConfigurationResourceServiceConfigurationsRestClient.Get(Id.Parent, Id.Name, serviceConfigurationName, 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.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName} + /// + /// + /// Operation Id + /// ServiceConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The service name. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetIfExistsAsync(string serviceConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(serviceConfigurationName, nameof(serviceConfigurationName)); + + using var scope = _serviceConfigurationResourceServiceConfigurationsClientDiagnostics.CreateScope("ServiceConfigurationResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _serviceConfigurationResourceServiceConfigurationsRestClient.GetAsync(Id.Parent, Id.Name, serviceConfigurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ServiceConfigurationResource(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.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName} + /// + /// + /// Operation Id + /// ServiceConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The service name. + /// The cancellation token to use. + /// is null. + public virtual NullableResponse GetIfExists(string serviceConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(serviceConfigurationName, nameof(serviceConfigurationName)); + + using var scope = _serviceConfigurationResourceServiceConfigurationsClientDiagnostics.CreateScope("ServiceConfigurationResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _serviceConfigurationResourceServiceConfigurationsRestClient.Get(Id.Parent, Id.Name, serviceConfigurationName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ServiceConfigurationResource(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/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ServiceConfigurationResourceData.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ServiceConfigurationResourceData.Serialization.cs new file mode 100644 index 0000000000000..d087ab9a7bc9f --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ServiceConfigurationResourceData.Serialization.cs @@ -0,0 +1,218 @@ +// 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; +using Azure.ResourceManager.HybridConnectivity.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + public partial class ServiceConfigurationResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceConfigurationResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ServiceName)) + { + writer.WritePropertyName("serviceName"u8); + writer.WriteStringValue(ServiceName.Value.ToString()); + } + if (Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + if (Optional.IsDefined(Port)) + { + writer.WritePropertyName("port"u8); + writer.WriteNumberValue(Port.Value); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + } + + ServiceConfigurationResourceData 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(ServiceConfigurationResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceConfigurationResourceData(document.RootElement, options); + } + + internal static ServiceConfigurationResourceData DeserializeServiceConfigurationResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + HybridConnectivityServiceName? serviceName = default; + ResourceIdentifier resourceId = default; + long? port = default; + HybridConnectivityProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("serviceName"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceName = new HybridConnectivityServiceName(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("resourceId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("port"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + port = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new HybridConnectivityProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServiceConfigurationResourceData( + id, + name, + type, + systemData, + serviceName, + resourceId, + port, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServiceConfigurationResourceData)} does not support writing '{options.Format}' format."); + } + } + + ServiceConfigurationResourceData 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 DeserializeServiceConfigurationResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServiceConfigurationResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ServiceConfigurationResourceData.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ServiceConfigurationResourceData.cs new file mode 100644 index 0000000000000..f8f37c3e01a83 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/ServiceConfigurationResourceData.cs @@ -0,0 +1,87 @@ +// 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.HybridConnectivity.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + /// + /// A class representing the ServiceConfigurationResource data model. + /// The service configuration details associated with the target resource. + /// + public partial class ServiceConfigurationResourceData : 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 ServiceConfigurationResourceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Name of the service. + /// The resource Id of the connectivity endpoint (optional). + /// The port on which service is enabled. + /// The resource provisioning state. + /// Keeps track of any properties unknown to the library. + internal ServiceConfigurationResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, HybridConnectivityServiceName? serviceName, ResourceIdentifier resourceId, long? port, HybridConnectivityProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ServiceName = serviceName; + ResourceId = resourceId; + Port = port; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the service. + public HybridConnectivityServiceName? ServiceName { get; set; } + /// The resource Id of the connectivity endpoint (optional). + public ResourceIdentifier ResourceId { get; set; } + /// The port on which service is enabled. + public long? Port { get; set; } + /// The resource provisioning state. + public HybridConnectivityProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionConfigurationCollection.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionConfigurationCollection.cs new file mode 100644 index 0000000000000..87102d9f86d70 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionConfigurationCollection.cs @@ -0,0 +1,487 @@ +// 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.HybridConnectivity +{ + /// + /// 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 GetSolutionConfigurations method from an instance of . + /// + public partial class SolutionConfigurationCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _solutionConfigurationClientDiagnostics; + private readonly SolutionConfigurationsRestOperations _solutionConfigurationRestClient; + + /// Initializes a new instance of the class for mocking. + protected SolutionConfigurationCollection() + { + } + + /// 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 SolutionConfigurationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _solutionConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridConnectivity", SolutionConfigurationResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(SolutionConfigurationResource.ResourceType, out string solutionConfigurationApiVersion); + _solutionConfigurationRestClient = new SolutionConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, solutionConfigurationApiVersion); + } + + /// + /// Create a SolutionConfiguration + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-12-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. + /// Represent Solution Configuration Resource. + /// Resource create parameters. + /// 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 solutionConfiguration, SolutionConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _solutionConfigurationClientDiagnostics.CreateScope("SolutionConfigurationCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _solutionConfigurationRestClient.CreateOrUpdateAsync(Id, solutionConfiguration, data, cancellationToken).ConfigureAwait(false); + var uri = _solutionConfigurationRestClient.CreateCreateOrUpdateRequestUri(Id, solutionConfiguration, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new HybridConnectivityArmOperation(Response.FromValue(new SolutionConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a SolutionConfiguration + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-12-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. + /// Represent Solution Configuration Resource. + /// Resource create parameters. + /// 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 solutionConfiguration, SolutionConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _solutionConfigurationClientDiagnostics.CreateScope("SolutionConfigurationCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _solutionConfigurationRestClient.CreateOrUpdate(Id, solutionConfiguration, data, cancellationToken); + var uri = _solutionConfigurationRestClient.CreateCreateOrUpdateRequestUri(Id, solutionConfiguration, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new HybridConnectivityArmOperation(Response.FromValue(new SolutionConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SolutionConfiguration + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Represent Solution Configuration 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 solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + + using var scope = _solutionConfigurationClientDiagnostics.CreateScope("SolutionConfigurationCollection.Get"); + scope.Start(); + try + { + var response = await _solutionConfigurationRestClient.GetAsync(Id, solutionConfiguration, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SolutionConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SolutionConfiguration + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Represent Solution Configuration Resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + + using var scope = _solutionConfigurationClientDiagnostics.CreateScope("SolutionConfigurationCollection.Get"); + scope.Start(); + try + { + var response = _solutionConfigurationRestClient.Get(Id, solutionConfiguration, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SolutionConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List SolutionConfiguration resources by parent + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations + /// + /// + /// Operation Id + /// SolutionConfigurations_List + /// + /// + /// Default Api Version + /// 2024-12-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) => _solutionConfigurationRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _solutionConfigurationRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SolutionConfigurationResource(Client, SolutionConfigurationData.DeserializeSolutionConfigurationData(e)), _solutionConfigurationClientDiagnostics, Pipeline, "SolutionConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List SolutionConfiguration resources by parent + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations + /// + /// + /// Operation Id + /// SolutionConfigurations_List + /// + /// + /// Default Api Version + /// 2024-12-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) => _solutionConfigurationRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _solutionConfigurationRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SolutionConfigurationResource(Client, SolutionConfigurationData.DeserializeSolutionConfigurationData(e)), _solutionConfigurationClientDiagnostics, Pipeline, "SolutionConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Represent Solution Configuration 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 solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + + using var scope = _solutionConfigurationClientDiagnostics.CreateScope("SolutionConfigurationCollection.Exists"); + scope.Start(); + try + { + var response = await _solutionConfigurationRestClient.GetAsync(Id, solutionConfiguration, 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.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Represent Solution Configuration Resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + + using var scope = _solutionConfigurationClientDiagnostics.CreateScope("SolutionConfigurationCollection.Exists"); + scope.Start(); + try + { + var response = _solutionConfigurationRestClient.Get(Id, solutionConfiguration, 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.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Represent Solution Configuration 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 solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + + using var scope = _solutionConfigurationClientDiagnostics.CreateScope("SolutionConfigurationCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _solutionConfigurationRestClient.GetAsync(Id, solutionConfiguration, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SolutionConfigurationResource(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.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Represent Solution Configuration Resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string solutionConfiguration, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(solutionConfiguration, nameof(solutionConfiguration)); + + using var scope = _solutionConfigurationClientDiagnostics.CreateScope("SolutionConfigurationCollection.GetIfExists"); + scope.Start(); + try + { + var response = _solutionConfigurationRestClient.Get(Id, solutionConfiguration, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SolutionConfigurationResource(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/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionConfigurationData.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionConfigurationData.Serialization.cs new file mode 100644 index 0000000000000..195e3264d9332 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionConfigurationData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.HybridConnectivity.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + public partial class SolutionConfigurationData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SolutionConfigurationData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + SolutionConfigurationData 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(SolutionConfigurationData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSolutionConfigurationData(document.RootElement, options); + } + + internal static SolutionConfigurationData DeserializeSolutionConfigurationData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SolutionConfigurationProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = 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) + { + continue; + } + properties = SolutionConfigurationProperties.DeserializeSolutionConfigurationProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SolutionConfigurationData( + id, + name, + type, + systemData, + properties, + 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(SolutionConfigurationData)} does not support writing '{options.Format}' format."); + } + } + + SolutionConfigurationData 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 DeserializeSolutionConfigurationData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SolutionConfigurationData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionConfigurationData.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionConfigurationData.cs new file mode 100644 index 0000000000000..ade9a60f10f9b --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionConfigurationData.cs @@ -0,0 +1,75 @@ +// 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.HybridConnectivity.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + /// + /// A class representing the SolutionConfiguration data model. + /// Solution Configuration + /// + public partial class SolutionConfigurationData : 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 SolutionConfigurationData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal SolutionConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SolutionConfigurationProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public SolutionConfigurationProperties Properties { get; set; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionConfigurationResource.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionConfigurationResource.Serialization.cs new file mode 100644 index 0000000000000..18c0a804a0788 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionConfigurationResource.Serialization.cs @@ -0,0 +1,26 @@ +// 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.HybridConnectivity +{ + public partial class SolutionConfigurationResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + SolutionConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + SolutionConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionConfigurationResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionConfigurationResource.cs new file mode 100644 index 0000000000000..76c2c4071ad35 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionConfigurationResource.cs @@ -0,0 +1,495 @@ +// 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.HybridConnectivity.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + /// + /// A Class representing a SolutionConfiguration 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 GetSolutionConfigurationResource method. + /// Otherwise you can get one from its parent resource using the GetSolutionConfiguration method. + /// + public partial class SolutionConfigurationResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The resourceUri. + /// The solutionConfiguration. + public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, string solutionConfiguration) + { + var resourceId = $"{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _solutionConfigurationClientDiagnostics; + private readonly SolutionConfigurationsRestOperations _solutionConfigurationRestClient; + private readonly SolutionConfigurationData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.HybridConnectivity/solutionConfigurations"; + + /// Initializes a new instance of the class for mocking. + protected SolutionConfigurationResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal SolutionConfigurationResource(ArmClient client, SolutionConfigurationData 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 SolutionConfigurationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _solutionConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridConnectivity", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string solutionConfigurationApiVersion); + _solutionConfigurationRestClient = new SolutionConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, solutionConfigurationApiVersion); +#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 SolutionConfigurationData 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)); + } + + /// Gets a collection of HybridConnectivityInventoryResources in the SolutionConfiguration. + /// An object representing collection of HybridConnectivityInventoryResources and their operations over a HybridConnectivityInventoryResource. + public virtual HybridConnectivityInventoryResourceCollection GetHybridConnectivityInventoryResources() + { + return GetCachedClient(client => new HybridConnectivityInventoryResourceCollection(client, Id)); + } + + /// + /// Get a InventoryResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/inventory/{inventoryId} + /// + /// + /// Operation Id + /// Inventory_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Inventory resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetHybridConnectivityInventoryResourceAsync(string inventoryId, CancellationToken cancellationToken = default) + { + return await GetHybridConnectivityInventoryResources().GetAsync(inventoryId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a InventoryResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/inventory/{inventoryId} + /// + /// + /// Operation Id + /// Inventory_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Inventory resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetHybridConnectivityInventoryResource(string inventoryId, CancellationToken cancellationToken = default) + { + return GetHybridConnectivityInventoryResources().Get(inventoryId, cancellationToken); + } + + /// + /// Get a SolutionConfiguration + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _solutionConfigurationClientDiagnostics.CreateScope("SolutionConfigurationResource.Get"); + scope.Start(); + try + { + var response = await _solutionConfigurationRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SolutionConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SolutionConfiguration + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _solutionConfigurationClientDiagnostics.CreateScope("SolutionConfigurationResource.Get"); + scope.Start(); + try + { + var response = _solutionConfigurationRestClient.Get(Id.Parent, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SolutionConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a SolutionConfiguration + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_Delete + /// + /// + /// Default Api Version + /// 2024-12-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 = _solutionConfigurationClientDiagnostics.CreateScope("SolutionConfigurationResource.Delete"); + scope.Start(); + try + { + var response = await _solutionConfigurationRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _solutionConfigurationRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new HybridConnectivityArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a SolutionConfiguration + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_Delete + /// + /// + /// Default Api Version + /// 2024-12-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 = _solutionConfigurationClientDiagnostics.CreateScope("SolutionConfigurationResource.Delete"); + scope.Start(); + try + { + var response = _solutionConfigurationRestClient.Delete(Id.Parent, Id.Name, cancellationToken); + var uri = _solutionConfigurationRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new HybridConnectivityArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a SolutionConfiguration + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_Update + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(SolutionConfigurationPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _solutionConfigurationClientDiagnostics.CreateScope("SolutionConfigurationResource.Update"); + scope.Start(); + try + { + var response = await _solutionConfigurationRestClient.UpdateAsync(Id.Parent, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SolutionConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a SolutionConfiguration + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration} + /// + /// + /// Operation Id + /// SolutionConfigurations_Update + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual Response Update(SolutionConfigurationPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _solutionConfigurationClientDiagnostics.CreateScope("SolutionConfigurationResource.Update"); + scope.Start(); + try + { + var response = _solutionConfigurationRestClient.Update(Id.Parent, Id.Name, patch, cancellationToken); + return Response.FromValue(new SolutionConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Trigger immediate sync with source cloud + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/syncNow + /// + /// + /// Operation Id + /// SolutionConfigurations_SyncNow + /// + /// + /// Default Api Version + /// 2024-12-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> SyncNowAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _solutionConfigurationClientDiagnostics.CreateScope("SolutionConfigurationResource.SyncNow"); + scope.Start(); + try + { + var response = await _solutionConfigurationRestClient.SyncNowAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new HybridConnectivityArmOperation(new OperationStatusResultOperationSource(), _solutionConfigurationClientDiagnostics, Pipeline, _solutionConfigurationRestClient.CreateSyncNowRequest(Id.Parent, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Trigger immediate sync with source cloud + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/syncNow + /// + /// + /// Operation Id + /// SolutionConfigurations_SyncNow + /// + /// + /// Default Api Version + /// 2024-12-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 SyncNow(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _solutionConfigurationClientDiagnostics.CreateScope("SolutionConfigurationResource.SyncNow"); + scope.Start(); + try + { + var response = _solutionConfigurationRestClient.SyncNow(Id.Parent, Id.Name, cancellationToken); + var operation = new HybridConnectivityArmOperation(new OperationStatusResultOperationSource(), _solutionConfigurationClientDiagnostics, Pipeline, _solutionConfigurationRestClient.CreateSyncNowRequest(Id.Parent, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionTypeResource.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionTypeResource.Serialization.cs new file mode 100644 index 0000000000000..59b64769dc797 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionTypeResource.Serialization.cs @@ -0,0 +1,26 @@ +// 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.HybridConnectivity +{ + public partial class SolutionTypeResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + SolutionTypeResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + SolutionTypeResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionTypeResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionTypeResource.cs new file mode 100644 index 0000000000000..9c458c5c7528f --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionTypeResource.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.HybridConnectivity +{ + /// + /// A Class representing a SolutionTypeResource 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 GetSolutionTypeResource method. + /// Otherwise you can get one from its parent resource using the GetSolutionTypeResource method. + /// + public partial class SolutionTypeResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The solutionType. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string solutionType) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes/{solutionType}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _solutionTypeResourceSolutionTypesClientDiagnostics; + private readonly SolutionTypesRestOperations _solutionTypeResourceSolutionTypesRestClient; + private readonly SolutionTypeResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.HybridConnectivity/solutionTypes"; + + /// Initializes a new instance of the class for mocking. + protected SolutionTypeResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal SolutionTypeResource(ArmClient client, SolutionTypeResourceData 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 SolutionTypeResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _solutionTypeResourceSolutionTypesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridConnectivity", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string solutionTypeResourceSolutionTypesApiVersion); + _solutionTypeResourceSolutionTypesRestClient = new SolutionTypesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, solutionTypeResourceSolutionTypesApiVersion); +#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 SolutionTypeResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a SolutionTypeResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes/{solutionType} + /// + /// + /// Operation Id + /// SolutionTypes_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _solutionTypeResourceSolutionTypesClientDiagnostics.CreateScope("SolutionTypeResource.Get"); + scope.Start(); + try + { + var response = await _solutionTypeResourceSolutionTypesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SolutionTypeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SolutionTypeResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes/{solutionType} + /// + /// + /// Operation Id + /// SolutionTypes_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _solutionTypeResourceSolutionTypesClientDiagnostics.CreateScope("SolutionTypeResource.Get"); + scope.Start(); + try + { + var response = _solutionTypeResourceSolutionTypesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SolutionTypeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionTypeResourceCollection.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionTypeResourceCollection.cs new file mode 100644 index 0000000000000..7d3003ed9ebc0 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionTypeResourceCollection.cs @@ -0,0 +1,396 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.HybridConnectivity +{ + /// + /// 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 GetSolutionTypeResources method from an instance of . + /// + public partial class SolutionTypeResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _solutionTypeResourceSolutionTypesClientDiagnostics; + private readonly SolutionTypesRestOperations _solutionTypeResourceSolutionTypesRestClient; + + /// Initializes a new instance of the class for mocking. + protected SolutionTypeResourceCollection() + { + } + + /// 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 SolutionTypeResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _solutionTypeResourceSolutionTypesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridConnectivity", SolutionTypeResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(SolutionTypeResource.ResourceType, out string solutionTypeResourceSolutionTypesApiVersion); + _solutionTypeResourceSolutionTypesRestClient = new SolutionTypesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, solutionTypeResourceSolutionTypesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Get a SolutionTypeResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes/{solutionType} + /// + /// + /// Operation Id + /// SolutionTypes_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Solution Type 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 solutionType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(solutionType, nameof(solutionType)); + + using var scope = _solutionTypeResourceSolutionTypesClientDiagnostics.CreateScope("SolutionTypeResourceCollection.Get"); + scope.Start(); + try + { + var response = await _solutionTypeResourceSolutionTypesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, solutionType, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SolutionTypeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SolutionTypeResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes/{solutionType} + /// + /// + /// Operation Id + /// SolutionTypes_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Solution Type resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string solutionType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(solutionType, nameof(solutionType)); + + using var scope = _solutionTypeResourceSolutionTypesClientDiagnostics.CreateScope("SolutionTypeResourceCollection.Get"); + scope.Start(); + try + { + var response = _solutionTypeResourceSolutionTypesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, solutionType, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SolutionTypeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List SolutionTypeResource resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes + /// + /// + /// Operation Id + /// SolutionTypes_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-12-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) => _solutionTypeResourceSolutionTypesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _solutionTypeResourceSolutionTypesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SolutionTypeResource(Client, SolutionTypeResourceData.DeserializeSolutionTypeResourceData(e)), _solutionTypeResourceSolutionTypesClientDiagnostics, Pipeline, "SolutionTypeResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List SolutionTypeResource resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes + /// + /// + /// Operation Id + /// SolutionTypes_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-12-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) => _solutionTypeResourceSolutionTypesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _solutionTypeResourceSolutionTypesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SolutionTypeResource(Client, SolutionTypeResourceData.DeserializeSolutionTypeResourceData(e)), _solutionTypeResourceSolutionTypesClientDiagnostics, Pipeline, "SolutionTypeResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes/{solutionType} + /// + /// + /// Operation Id + /// SolutionTypes_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Solution Type 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 solutionType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(solutionType, nameof(solutionType)); + + using var scope = _solutionTypeResourceSolutionTypesClientDiagnostics.CreateScope("SolutionTypeResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _solutionTypeResourceSolutionTypesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, solutionType, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes/{solutionType} + /// + /// + /// Operation Id + /// SolutionTypes_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Solution Type resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string solutionType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(solutionType, nameof(solutionType)); + + using var scope = _solutionTypeResourceSolutionTypesClientDiagnostics.CreateScope("SolutionTypeResourceCollection.Exists"); + scope.Start(); + try + { + var response = _solutionTypeResourceSolutionTypesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, solutionType, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes/{solutionType} + /// + /// + /// Operation Id + /// SolutionTypes_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Solution Type 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 solutionType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(solutionType, nameof(solutionType)); + + using var scope = _solutionTypeResourceSolutionTypesClientDiagnostics.CreateScope("SolutionTypeResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _solutionTypeResourceSolutionTypesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, solutionType, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SolutionTypeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes/{solutionType} + /// + /// + /// Operation Id + /// SolutionTypes_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Solution Type resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string solutionType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(solutionType, nameof(solutionType)); + + using var scope = _solutionTypeResourceSolutionTypesClientDiagnostics.CreateScope("SolutionTypeResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _solutionTypeResourceSolutionTypesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, solutionType, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SolutionTypeResource(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/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionTypeResourceData.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionTypeResourceData.Serialization.cs new file mode 100644 index 0000000000000..1d9efc8d3384a --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionTypeResourceData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.HybridConnectivity.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + public partial class SolutionTypeResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SolutionTypeResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + SolutionTypeResourceData 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(SolutionTypeResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSolutionTypeResourceData(document.RootElement, options); + } + + internal static SolutionTypeResourceData DeserializeSolutionTypeResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SolutionTypeProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = 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) + { + continue; + } + properties = SolutionTypeProperties.DeserializeSolutionTypeProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SolutionTypeResourceData( + id, + name, + type, + systemData, + properties, + 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(SolutionTypeResourceData)} does not support writing '{options.Format}' format."); + } + } + + SolutionTypeResourceData 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 DeserializeSolutionTypeResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SolutionTypeResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionTypeResourceData.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionTypeResourceData.cs new file mode 100644 index 0000000000000..5318ae08d4dad --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/SolutionTypeResourceData.cs @@ -0,0 +1,75 @@ +// 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.HybridConnectivity.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridConnectivity +{ + /// + /// A class representing the SolutionTypeResource data model. + /// Concrete proxy resource types can be created by aliasing this type using a specific property type. + /// + public partial class SolutionTypeResourceData : 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 SolutionTypeResourceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal SolutionTypeResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SolutionTypeProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public SolutionTypeProperties Properties { get; set; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/autorest.md b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/autorest.md index a022060a3599c..e9114910b53fa 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/autorest.md +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/autorest.md @@ -9,7 +9,7 @@ csharp: true library-name: HybridConnectivity namespace: Azure.ResourceManager.HybridConnectivity # default tag is a preview version -require: https://github.com/Azure/azure-rest-api-specs/blob/3c162c839b8fe17544d9a3be8383a835dd42eb28/specification/hybridconnectivity/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/fe44d3261ff0ea816315126120672ccec78c3074/specification/hybridconnectivity/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -50,6 +50,24 @@ acronym-mapping: URI: Uri Etag: ETag|etag +prepend-rp-prefix: + - InventoryResource + - CloudNativeType + - EndpointProperties + - HostType + - InventoryProperties + - ProvisioningState + - ResourceProvisioningState + - ServiceName + +rename-mapping: + # IngressGatewayResource and ManagedProxyResource are not ARM resource but end with Resource suffix which is not allowed, so we need to rename them + IngressGatewayResource: IngressGatewayAsset + ManagedProxyResource: ManagedProxyAsset + # format transform + AADProfileProperties.serverId: -|uuid + PublicCloudConnectorProperties.connectorPrimaryIdentifier: -|uuid + directive: - rename-model: from: EndpointAccessResource @@ -64,4 +82,25 @@ directive: transform: > $["x-ms-client-name"] = "scope" + # To generate as Azure.Core.ResourceIdentifier + - from: swagger-document + where: $.definitions.ServiceConfigurationProperties.properties.resourceId + transform: $['x-ms-format'] = 'arm-id' + + - from: swagger-document + where: $.definitions.GenerateAwsTemplateRequest.properties.connectorId + transform: $['x-ms-format'] = 'arm-id' + + - from: swagger-document + where: $.definitions.InventoryProperties.properties.azureResourceId + transform: $['x-ms-format'] = 'arm-id' + + - from: swagger-document + where: $.definitions.EndpointProperties.properties.resourceId + transform: $['x-ms-format'] = 'arm-id' + + - from: swagger-document + where: $.definitions.AADProfileProperties.properties.serverId + transform: $['x-ms-format'] = 'arm-id' + ``` diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/tests/Azure.ResourceManager.HybridConnectivity.Tests.csproj b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/tests/Azure.ResourceManager.HybridConnectivity.Tests.csproj index 9ec3fc73b24bf..286e584c88f17 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/tests/Azure.ResourceManager.HybridConnectivity.Tests.csproj +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/tests/Azure.ResourceManager.HybridConnectivity.Tests.csproj @@ -1,6 +1,11 @@  + + + + + diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/tests/HybridConnectivityManagementTestBase.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/tests/HybridConnectivityManagementTestBase.cs new file mode 100644 index 0000000000000..fabfea9bd71e6 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/tests/HybridConnectivityManagementTestBase.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; +using System; +using Azure.Identity; +using Azure.ResourceManager.HybridConnectivity.Models; +using Azure.ResourceManager.Models; +using System.Collections.Generic; +using System.Xml; +using Castle.Components.DictionaryAdapter.Xml; + +namespace Azure.ResourceManager.HybridConnectivity.Tests +{ + public abstract class HybridConnectivityManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient ArmClient { get; private set; } + protected AzureLocation DefaultLocation = AzureLocation.EastUS; + protected const string DefaultResourceGroupPrefix = "HybridConnectivitySDKRG"; + protected const string ConnectorName = "MultiCloudSDKTestConnectorName"; + protected const string SolutionConfigurationName = "TestSolutionConfigName"; + protected const string AssetManagementType = "Microsoft.AssetManagement"; + + protected HybridConnectivityManagementTestBase(bool isAsync, RecordedTestMode? mode = null) + : base(isAsync, mode) + { + } + + [SetUp] + public void CreateCommonClient() + { + ArmClient = GetArmClient(); + } + + protected async Task CreateResourceGroup() + { + var subscription = await ArmClient.GetDefaultSubscriptionAsync(); + string rgName = Recording.GenerateAssetName(DefaultResourceGroupPrefix); + ResourceGroupData input = new ResourceGroupData(DefaultLocation); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + + protected async Task CreatePublicCloudConnector(ResourceGroupResource rg) + { + var connectorData = new PublicCloudConnectorData(DefaultLocation) { }; + + var awsCloudProfile = new AwsCloudProfile("123456789123") { }; + awsCloudProfile.IsOrganizationalAccount = false; + + var properties = new PublicCloudConnectorProperties(awsCloudProfile, HybridConnectivityHostType.AWS) { }; + + connectorData.Properties = properties; + + var collection = rg.GetPublicCloudConnectors(); + var pcc = await collection.CreateOrUpdateAsync(WaitUntil.Completed, ConnectorName, connectorData); + return pcc.Value; + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/tests/Scenario/HybridConnectivityPublicCloudConnectorTest.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/tests/Scenario/HybridConnectivityPublicCloudConnectorTest.cs new file mode 100644 index 0000000000000..262c82561d97e --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/tests/Scenario/HybridConnectivityPublicCloudConnectorTest.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Azure.ResourceManager.HybridConnectivity; +using Azure.ResourceManager.HybridConnectivity.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; + +namespace Azure.ResourceManager.HybridConnectivity.Tests.Scenario +{ + public class HybridConnectivityPublicCloudConnectorTest : HybridConnectivityManagementTestBase + { + private PublicCloudConnectorResource _testConnector; + + private ResourceGroupResource _testRG; + + public HybridConnectivityPublicCloudConnectorTest(bool isAsync) : base(isAsync) //, RecordedTestMode.Record) + { + } + + [SetUp] + public async Task TestSetUp() + { + _testRG = await CreateResourceGroup(); + Assert.IsNotNull(_testRG, "Resource Group initialization failed."); + + _testConnector = await CreatePublicCloudConnector(_testRG); + Assert.IsNotNull(_testConnector, "Public Cloud Connector initialization failed."); + } + + [TearDown] + public async Task TearDown() + { + var deleteResp = await _testConnector.DeleteAsync(WaitUntil.Completed); + Assert.AreEqual(200, deleteResp.GetRawResponse().Status); + } + + [RecordedTest] + public async Task TestPublicCloudConnector() + { + var connectorCollection = _testRG.GetPublicCloudConnectors(); + Assert.IsNotNull(connectorCollection); + + await createSolutionConfiguration(); + + var testPermissionResp = await _testConnector.TestPermissionsAsync(WaitUntil.Completed); + Assert.IsNotNull(testPermissionResp); + Assert.AreEqual(200, testPermissionResp.GetRawResponse().Status); + } + + [RecordedTest] + public async Task TestSolutionConfiguration() + { + var sc = await createSolutionConfiguration(); + + var patchData = new SolutionConfigurationPatch(); + patchData.Properties = new SolutionConfigurationPropertiesUpdate(); + patchData.Properties.SolutionType = "Microsoft.AssetManagement"; + patchData.Properties.SolutionSettings.Add("periodicSync", "true"); + patchData.Properties.SolutionSettings.Add("periodicSyncTime", "2"); + + var updateResp = await sc.UpdateAsync(patchData); + Assert.AreEqual(200, updateResp.GetRawResponse().Status); + Assert.AreEqual("2", updateResp.Value.Data.Properties.SolutionSettings["periodicSyncTime"]); + + var deleteResp = await sc.DeleteAsync(WaitUntil.Completed); + Assert.AreEqual(200, deleteResp.GetRawResponse().Status); + } + + protected async Task createSolutionConfiguration() + { + var scopeId = _testConnector.Id; + var scCollection = ArmClient.GetSolutionConfigurations(scopeId); + Assert.IsNotNull(scCollection); + + var scProperties = new SolutionConfigurationProperties(AssetManagementType); + scProperties.SolutionSettings.Add("periodicSync", "true"); + scProperties.SolutionSettings.Add("periodicSyncTime", "1"); + scProperties.SolutionSettings.Add("cloudProviderServiceTypes", "ec2,s3"); + scProperties.SolutionSettings.Add("awsGlobalReadOnly", "true"); + scProperties.SolutionSettings.Add("cloudProviderRegions", "us-east-1"); + + var scData = new SolutionConfigurationData(); + scData.Properties = scProperties; + + var scTask = await scCollection.CreateOrUpdateAsync(WaitUntil.Completed, SolutionConfigurationName, scData); + var sc = scTask.Value; + Assert.IsNotNull(sc); + return sc; + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/tests/hybridconnectivityManagementTestEnvironment.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/tests/hybridconnectivityManagementTestEnvironment.cs index db5d0c8d09084..c095519a72a09 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/tests/hybridconnectivityManagementTestEnvironment.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/tests/hybridconnectivityManagementTestEnvironment.cs @@ -5,7 +5,7 @@ namespace Azure.ResourceManager.HybridConnectivity.Tests { - public class hybridconnectivityManagementTestEnvironment : TestEnvironment + public class HybridconnectivityManagementTestEnvironment : TestEnvironment { } -} \ No newline at end of file +} diff --git a/sdk/hybridconnectivity/test-resources.json b/sdk/hybridconnectivity/test-resources.json new file mode 100644 index 0000000000000..a837d5a0f2b84 --- /dev/null +++ b/sdk/hybridconnectivity/test-resources.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [ + ] +}