public virtual Response <SyncMemberResource> Get(string syncMemberName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(syncMemberName, nameof(syncMemberName)); using var scope = _syncMemberClientDiagnostics.CreateScope("SyncMemberCollection.Get"); scope.Start(); try { var response = _syncMemberRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, syncMemberName, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new SyncMemberResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <SyncMember> Get(CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SyncMember.Get"); scope.Start(); try { var response = _syncMembersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) { throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new SyncMember(this, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }