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 7fce9485b6ec8..4d86b0d92d095 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,12 @@ 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(long? expiresin = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIngressGatewayCredentialsAsync(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 Update(Azure.ResourceManager.HybridConnectivity.EndpointResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.HybridConnectivity.EndpointResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -43,6 +47,7 @@ public EndpointResourceData() { } public System.DateTimeOffset? LastModifiedOn { get { throw null; } set { } } public string ProvisioningState { get { throw null; } } public string ResourceId { get { throw null; } set { } } + public System.Collections.Generic.IList ServiceConfigurations { get { throw null; } } } public static partial class HybridConnectivityExtensions { @@ -92,6 +97,61 @@ namespace Azure.ResourceManager.HybridConnectivity.Models 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 IngressGatewayResource + { + internal IngressGatewayResource() { } + 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 string ServerId { get { throw null; } } + public string ServiceConfigurationToken { get { throw null; } } + public System.Guid? TenantId { get { throw null; } } + } + public partial class ListCredentialsContent + { + public ListCredentialsContent() { } + public Azure.ResourceManager.HybridConnectivity.Models.ServiceName? ServiceName { get { throw null; } set { } } + } + public partial class ManagedProxyContent + { + public ManagedProxyContent(string service) { } + public string Hostname { get { throw null; } set { } } + public string Service { get { throw null; } } + public Azure.ResourceManager.HybridConnectivity.Models.ServiceName? ServiceName { get { throw null; } set { } } + } + public partial class ManagedProxyResource + { + internal ManagedProxyResource() { } + public long ExpiresOn { get { throw null; } } + public string Proxy { get { throw null; } } + } + public partial class ServiceConfiguration + { + public ServiceConfiguration() { } + public string Port { get { throw null; } set { } } + public Azure.ResourceManager.HybridConnectivity.Models.ServiceName? ServiceName { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ServiceName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ServiceName(string value) { throw null; } + public static Azure.ResourceManager.HybridConnectivity.Models.ServiceName SSH { get { throw null; } } + public static Azure.ResourceManager.HybridConnectivity.Models.ServiceName WAC { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridConnectivity.Models.ServiceName 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.ServiceName left, Azure.ResourceManager.HybridConnectivity.Models.ServiceName right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridConnectivity.Models.ServiceName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridConnectivity.Models.ServiceName left, Azure.ResourceManager.HybridConnectivity.Models.ServiceName right) { throw null; } + public override string ToString() { throw null; } + } public partial class TargetResourceEndpointAccess { internal TargetResourceEndpointAccess() { } @@ -100,5 +160,6 @@ 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; } } } } diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResource.cs index 3c1bacbfb7414..0fbb9c2a66813 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResource.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResource.cs @@ -244,15 +244,16 @@ public virtual Response Update(EndpointResourceData data, Canc /// Request Path: /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/listCredentials /// Operation Id: Endpoints_ListCredentials /// + /// 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) @@ -267,15 +268,114 @@ public virtual async Task> GetCredentials /// Request Path: /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/listCredentials /// Operation Id: Endpoints_ListCredentials /// + /// 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 + /// + /// The is how long the endpoint access token is valid (in seconds). + /// The cancellation token to use. + public virtual async Task> GetIngressGatewayCredentialsAsync(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, 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 + /// + /// The is how long the endpoint access token is valid (in seconds). + /// The cancellation token to use. + public virtual Response GetIngressGatewayCredentials(long? expiresin = null, CancellationToken cancellationToken = default) + { + using var scope = _endpointResourceEndpointsClientDiagnostics.CreateScope("EndpointResource.GetIngressGatewayCredentials"); + scope.Start(); + try + { + var response = _endpointResourceEndpointsRestClient.ListIngressGatewayCredentials(Id.Parent, Id.Name, 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 + /// + /// 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 + /// + /// 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/EndpointResourceData.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResourceData.cs index 41919f037bd1d..d2266906b531a 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResourceData.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/EndpointResourceData.cs @@ -6,6 +6,7 @@ #nullable disable using System; +using System.Collections.Generic; using Azure.Core; using Azure.ResourceManager.HybridConnectivity.Models; using Azure.ResourceManager.Models; @@ -18,6 +19,7 @@ public partial class EndpointResourceData : ResourceData /// Initializes a new instance of EndpointResourceData. public EndpointResourceData() { + ServiceConfigurations = new ChangeTrackingList(); } /// Initializes a new instance of EndpointResourceData. @@ -27,18 +29,20 @@ public EndpointResourceData() /// The systemData. /// The type of endpoint. /// The resource Id of the connectivity endpoint (optional). - /// + /// The resource provisioning state. + /// The enabled service configurations. /// 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). - 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) : base(id, name, resourceType, systemData) + internal EndpointResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, EndpointType? endpointType, string resourceId, string provisioningState, IList serviceConfigurations, string createdBy, Models.CreatedByType? createdByType, DateTimeOffset? createdOn, string lastModifiedBy, Models.CreatedByType? lastModifiedByType, DateTimeOffset? lastModifiedOn) : base(id, name, resourceType, systemData) { EndpointType = endpointType; ResourceId = resourceId; ProvisioningState = provisioningState; + ServiceConfigurations = serviceConfigurations; CreatedBy = createdBy; CreatedByType = createdByType; CreatedOn = createdOn; @@ -51,8 +55,10 @@ internal EndpointResourceData(ResourceIdentifier id, string name, ResourceType r public EndpointType? EndpointType { get; set; } /// The resource Id of the connectivity endpoint (optional). public string ResourceId { get; set; } - /// Gets the provisioning state. + /// The resource provisioning state. public string ProvisioningState { get; } + /// The enabled service configurations. + public IList ServiceConfigurations { get; } /// The identity that created the resource. public string CreatedBy { get; set; } /// The type of identity that created the resource. diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/EndpointResourceData.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/EndpointResourceData.Serialization.cs index 7051f9174582b..659fd227c950b 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/EndpointResourceData.Serialization.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/EndpointResourceData.Serialization.cs @@ -6,6 +6,7 @@ #nullable disable using System; +using System.Collections.Generic; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.HybridConnectivity.Models; @@ -30,6 +31,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("resourceId"); writer.WriteStringValue(ResourceId); } + if (Optional.IsCollectionDefined(ServiceConfigurations)) + { + writer.WritePropertyName("serviceConfigurations"); + writer.WriteStartArray(); + foreach (var item in ServiceConfigurations) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } writer.WriteEndObject(); writer.WritePropertyName("systemData"); writer.WriteStartObject(); @@ -76,6 +87,7 @@ internal static EndpointResourceData DeserializeEndpointResourceData(JsonElement Optional type0 = default; Optional resourceId = default; Optional provisioningState = default; + Optional> serviceConfigurations = default; Optional createdBy = default; Optional createdByType = default; Optional createdAt = default; @@ -138,6 +150,21 @@ internal static EndpointResourceData DeserializeEndpointResourceData(JsonElement provisioningState = property0.Value.GetString(); continue; } + if (property0.NameEquals("serviceConfigurations")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ServiceConfiguration.DeserializeServiceConfiguration(item)); + } + serviceConfigurations = array; + continue; + } } continue; } @@ -204,7 +231,7 @@ internal static EndpointResourceData DeserializeEndpointResourceData(JsonElement continue; } } - return new EndpointResourceData(id, name, type, systemData.Value, Optional.ToNullable(type0), resourceId.Value, provisioningState.Value, createdBy.Value, Optional.ToNullable(createdByType), Optional.ToNullable(createdAt), lastModifiedBy.Value, Optional.ToNullable(lastModifiedByType), Optional.ToNullable(lastModifiedAt)); + return new EndpointResourceData(id, name, type, systemData.Value, Optional.ToNullable(type0), resourceId.Value, provisioningState.Value, Optional.ToList(serviceConfigurations), createdBy.Value, Optional.ToNullable(createdByType), Optional.ToNullable(createdAt), lastModifiedBy.Value, Optional.ToNullable(lastModifiedByType), Optional.ToNullable(lastModifiedAt)); } } } diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/IngressGatewayResource.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/IngressGatewayResource.Serialization.cs new file mode 100644 index 0000000000000..28db0bc27e4c1 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/IngressGatewayResource.Serialization.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + public partial class IngressGatewayResource + { + internal static IngressGatewayResource DeserializeIngressGatewayResource(JsonElement element) + { + Optional hostname = default; + Optional serverId = default; + Optional tenantId = default; + Optional namespaceName = default; + Optional namespaceNameSuffix = default; + Optional hybridConnectionName = default; + Optional accessKey = default; + Optional expiresOn = default; + Optional serviceConfigurationToken = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ingress")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("hostname")) + { + hostname = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("aadProfile")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property1 in property0.Value.EnumerateObject()) + { + if (property1.NameEquals("serverId")) + { + serverId = property1.Value.GetString(); + continue; + } + if (property1.NameEquals("tenantId")) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + property1.ThrowNonNullablePropertyIsNull(); + continue; + } + tenantId = property1.Value.GetGuid(); + continue; + } + } + continue; + } + } + continue; + } + if (property.NameEquals("relay")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("namespaceName")) + { + namespaceName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("namespaceNameSuffix")) + { + namespaceNameSuffix = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hybridConnectionName")) + { + hybridConnectionName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("accessKey")) + { + accessKey = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("expiresOn")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + expiresOn = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("serviceConfigurationToken")) + { + serviceConfigurationToken = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new IngressGatewayResource(hostname.Value, serverId.Value, Optional.ToNullable(tenantId), namespaceName.Value, namespaceNameSuffix.Value, hybridConnectionName.Value, accessKey.Value, Optional.ToNullable(expiresOn), serviceConfigurationToken.Value); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/IngressGatewayResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/IngressGatewayResource.cs new file mode 100644 index 0000000000000..05e0ba72c07e7 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/IngressGatewayResource.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// The ingress gateway access credentials. + public partial class IngressGatewayResource + { + /// Initializes a new instance of IngressGatewayResource. + internal IngressGatewayResource() + { + } + + /// Initializes a new instance of IngressGatewayResource. + /// 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. + internal IngressGatewayResource(string hostname, string serverId, Guid? tenantId, string namespaceName, string namespaceNameSuffix, string hybridConnectionName, string accessKey, long? expiresOn, string serviceConfigurationToken) + { + Hostname = hostname; + ServerId = serverId; + TenantId = tenantId; + NamespaceName = namespaceName; + NamespaceNameSuffix = namespaceNameSuffix; + HybridConnectionName = hybridConnectionName; + AccessKey = accessKey; + ExpiresOn = expiresOn; + ServiceConfigurationToken = serviceConfigurationToken; + } + + /// The ingress hostname. + public string Hostname { get; } + /// The arc ingress gateway server app id. + public string 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/ListCredentialsContent.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ListCredentialsContent.Serialization.cs new file mode 100644 index 0000000000000..01f26c23c5d77 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ListCredentialsContent.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + public partial class ListCredentialsContent : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ServiceName)) + { + writer.WritePropertyName("serviceName"); + writer.WriteStringValue(ServiceName.Value.ToString()); + } + writer.WriteEndObject(); + } + } +} 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..8fd7d109173df --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ListCredentialsContent.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Represent ListCredentials Request object. + public partial class ListCredentialsContent + { + /// Initializes a new instance of ListCredentialsContent. + public ListCredentialsContent() + { + } + + /// The name of the service. + public ServiceName? ServiceName { get; set; } + } +} 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..9fe312014e1d3 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyContent.Serialization.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + public partial class ManagedProxyContent : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("service"); + writer.WriteStringValue(Service); + if (Optional.IsDefined(Hostname)) + { + writer.WritePropertyName("hostname"); + writer.WriteStringValue(Hostname); + } + if (Optional.IsDefined(ServiceName)) + { + writer.WritePropertyName("serviceName"); + writer.WriteStringValue(ServiceName.Value.ToString()); + } + writer.WriteEndObject(); + } + } +} 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..5694bc90c9f83 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyContent.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Represent ManageProxy Request object. + public partial class ManagedProxyContent + { + /// Initializes a new instance of ManagedProxyContent. + /// The name of the service. + /// is null. + public ManagedProxyContent(string service) + { + Argument.AssertNotNull(service, nameof(service)); + + Service = service; + } + + /// The name of the service. + public string Service { get; } + /// The target host name. + public string Hostname { get; set; } + /// The name of the service. + public ServiceName? ServiceName { get; set; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyResource.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyResource.Serialization.cs new file mode 100644 index 0000000000000..1e0f1b3b9f23b --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyResource.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + public partial class ManagedProxyResource + { + internal static ManagedProxyResource DeserializeManagedProxyResource(JsonElement element) + { + string proxy = default; + long expiresOn = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("proxy")) + { + proxy = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiresOn")) + { + expiresOn = property.Value.GetInt64(); + continue; + } + } + return new ManagedProxyResource(proxy, expiresOn); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyResource.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyResource.cs new file mode 100644 index 0000000000000..6f5fdc410f5af --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ManagedProxyResource.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// Managed Proxy. + public partial class ManagedProxyResource + { + /// Initializes a new instance of ManagedProxyResource. + /// The short lived proxy name. + /// The expiration time of short lived proxy name in unix epoch. + /// is null. + internal ManagedProxyResource(string proxy, long expiresOn) + { + Argument.AssertNotNull(proxy, nameof(proxy)); + + Proxy = proxy; + ExpiresOn = expiresOn; + } + + /// 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/ServiceConfiguration.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfiguration.Serialization.cs new file mode 100644 index 0000000000000..4c78000d2eeaf --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfiguration.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + public partial class ServiceConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ServiceName)) + { + writer.WritePropertyName("serviceName"); + writer.WriteStringValue(ServiceName.Value.ToString()); + } + if (Optional.IsDefined(Port)) + { + writer.WritePropertyName("port"); + writer.WriteStringValue(Port); + } + writer.WriteEndObject(); + } + + internal static ServiceConfiguration DeserializeServiceConfiguration(JsonElement element) + { + Optional serviceName = default; + Optional port = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serviceName")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + serviceName = new ServiceName(property.Value.GetString()); + continue; + } + if (property.NameEquals("port")) + { + port = property.Value.GetString(); + continue; + } + } + return new ServiceConfiguration(Optional.ToNullable(serviceName), port.Value); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfiguration.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfiguration.cs new file mode 100644 index 0000000000000..e0ecf8e2c8499 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceConfiguration.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.HybridConnectivity.Models +{ + /// The service configuration object definition. + public partial class ServiceConfiguration + { + /// Initializes a new instance of ServiceConfiguration. + public ServiceConfiguration() + { + } + + /// Initializes a new instance of ServiceConfiguration. + /// The type of service enabled. + /// The port on which service is enabled. + internal ServiceConfiguration(ServiceName? serviceName, string port) + { + ServiceName = serviceName; + Port = port; + } + + /// The type of service enabled. + public ServiceName? ServiceName { get; set; } + /// The port on which service is enabled. + public string Port { get; set; } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceName.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceName.cs new file mode 100644 index 0000000000000..a4f5cf6750b5c --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/ServiceName.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 +{ + /// The type of service enabled. + public readonly partial struct ServiceName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ServiceName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SSHValue = "SSH"; + private const string WACValue = "WAC"; + + /// SSH. + public static ServiceName SSH { get; } = new ServiceName(SSHValue); + /// WAC. + public static ServiceName WAC { get; } = new ServiceName(WACValue); + /// Determines if two values are the same. + public static bool operator ==(ServiceName left, ServiceName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ServiceName left, ServiceName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ServiceName(string value) => new ServiceName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ServiceName other && Equals(other); + /// + public bool Equals(ServiceName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/TargetResourceEndpointAccess.Serialization.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/TargetResourceEndpointAccess.Serialization.cs index 8e463fb5bce74..facba72057792 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 @@ -19,6 +19,7 @@ internal static TargetResourceEndpointAccess DeserializeTargetResourceEndpointAc Optional hybridConnectionName = default; Optional accessKey = default; Optional expiresOn = default; + Optional serviceConfigurationToken = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("relay")) @@ -60,11 +61,16 @@ internal static TargetResourceEndpointAccess DeserializeTargetResourceEndpointAc expiresOn = property0.Value.GetInt64(); continue; } + if (property0.NameEquals("serviceConfigurationToken")) + { + serviceConfigurationToken = property0.Value.GetString(); + continue; + } } continue; } } - return new TargetResourceEndpointAccess(namespaceName.Value, namespaceNameSuffix.Value, hybridConnectionName.Value, accessKey.Value, Optional.ToNullable(expiresOn)); + return new TargetResourceEndpointAccess(namespaceName.Value, namespaceNameSuffix.Value, hybridConnectionName.Value, accessKey.Value, Optional.ToNullable(expiresOn), serviceConfigurationToken.Value); } } } 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 aea434dac1b2c..9a7608d7cb0b1 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/TargetResourceEndpointAccess.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Models/TargetResourceEndpointAccess.cs @@ -21,13 +21,15 @@ internal TargetResourceEndpointAccess() /// Azure Relay hybrid connection name for the resource. /// Access key for hybrid connection. /// The expiration of access key in unix time. - internal TargetResourceEndpointAccess(string namespaceName, string namespaceNameSuffix, string hybridConnectionName, string accessKey, long? expiresOn) + /// The token to access the enabled service. + internal TargetResourceEndpointAccess(string namespaceName, string namespaceNameSuffix, string hybridConnectionName, string accessKey, long? expiresOn, string serviceConfigurationToken) { NamespaceName = namespaceName; NamespaceNameSuffix = namespaceNameSuffix; HybridConnectionName = hybridConnectionName; AccessKey = accessKey; ExpiresOn = expiresOn; + ServiceConfigurationToken = serviceConfigurationToken; } /// The namespace name. @@ -40,5 +42,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/RestOperations/EndpointsRestOperations.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/EndpointsRestOperations.cs index 9a9a031d05ace..fe0abe40e79aa 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/EndpointsRestOperations.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/RestOperations/EndpointsRestOperations.cs @@ -33,7 +33,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 ?? "2023-03-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -394,7 +394,7 @@ public Response Delete(string scope, string endpointName, CancellationToken canc } } - 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; @@ -413,6 +413,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); + request.Content = content0; + } _userAgent.Apply(message); return message; } @@ -420,15 +427,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) { @@ -447,15 +455,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) { @@ -471,6 +480,162 @@ public Response ListCredentials(string scope, stri } } + internal HttpMessage CreateListIngressGatewayCredentialsRequest(string scope, string endpointName, 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"); + _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. + /// 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, long? expiresin = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + + using var message = CreateListIngressGatewayCredentialsRequest(scope, endpointName, expiresin); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IngressGatewayResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IngressGatewayResource.DeserializeIngressGatewayResource(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. + /// 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, long? expiresin = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNull(endpointName, nameof(endpointName)); + + using var message = CreateListIngressGatewayCredentialsRequest(scope, endpointName, expiresin); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IngressGatewayResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IngressGatewayResource.DeserializeIngressGatewayResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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); + 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: + { + ManagedProxyResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ManagedProxyResource.DeserializeManagedProxyResource(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: + { + ManagedProxyResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ManagedProxyResource.DeserializeManagedProxyResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateListNextPageRequest(string nextLink, string scope) { var message = _pipeline.CreateMessage(); diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/autorest.md b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/autorest.md index a55732c723ea8..d72415f8b57fe 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: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/hybridconnectivity/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true