public virtual Response <PrivateDnsZoneGroup> Get(string privateDnsZoneGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(privateDnsZoneGroupName, nameof(privateDnsZoneGroupName)); using var scope = _privateDnsZoneGroupClientDiagnostics.CreateScope("PrivateDnsZoneGroupCollection.Get"); scope.Start(); try { var response = _privateDnsZoneGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateDnsZoneGroupName, cancellationToken); if (response.Value == null) { throw _privateDnsZoneGroupClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new PrivateDnsZoneGroup(ArmClient, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <PrivateDnsZoneGroup> Get(string privateDnsZoneGroupName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("PrivateDnsZoneGroupContainer.Get"); scope.Start(); try { if (privateDnsZoneGroupName == null) { throw new ArgumentNullException(nameof(privateDnsZoneGroupName)); } var response = _restClient.Get(Id.ResourceGroupName, Id.Name, privateDnsZoneGroupName, cancellationToken: cancellationToken); if (response.Value == null) { throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new PrivateDnsZoneGroup(Parent, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <PrivateDnsZoneGroupResource> Get(CancellationToken cancellationToken = default) { using var scope = _privateDnsZoneGroupClientDiagnostics.CreateScope("PrivateDnsZoneGroupResource.Get"); scope.Start(); try { var response = _privateDnsZoneGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new PrivateDnsZoneGroupResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }