public virtual Response <GalleryImageVersion> Get(ReplicationStatusTypes?expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("GalleryImageVersion.Get"); scope.Start(); try { var response = _galleryImageVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, expand, cancellationToken); if (response.Value == null) { throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new GalleryImageVersion(this, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <GalleryImageVersionResource> Get(string galleryImageVersionName, ReplicationStatusTypes?expand = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(galleryImageVersionName, nameof(galleryImageVersionName)); using var scope = _galleryImageVersionClientDiagnostics.CreateScope("GalleryImageVersionCollection.Get"); scope.Start(); try { var response = _galleryImageVersionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, galleryImageVersionName, expand, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new GalleryImageVersionResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <GalleryImageVersion> Get(string galleryImageVersionName, ReplicationStatusTypes?expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("GalleryImageVersionContainer.Get"); scope.Start(); try { if (galleryImageVersionName == null) { throw new ArgumentNullException(nameof(galleryImageVersionName)); } var response = _restClient.Get(Id.ResourceGroupName, Id.Parent.Name, Id.Name, galleryImageVersionName, expand, cancellationToken: cancellationToken); if (response.Value == null) { throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new GalleryImageVersion(Parent, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }