public virtual Pageable <VirtualMachineExtensionImage> GetAll(string type, string filter = null, int?top = null, string orderby = null, CancellationToken cancellationToken = default) { if (type == null) { throw new ArgumentNullException(nameof(type)); } Page <VirtualMachineExtensionImage> FirstPageFunc(int?pageSizeHint) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionImageCollection.GetAll"); scope.Start(); try { var response = _virtualMachineExtensionImagesRestClient.ListVersions(Id.SubscriptionId, _location, _publisherName, type, filter, top, orderby, cancellationToken: cancellationToken); return(Page.FromValues(response.Value.Select(value => new VirtualMachineExtensionImage(this, value)), null, response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } } return(PageableHelpers.CreateEnumerable(FirstPageFunc, null)); }
public virtual Response <IReadOnlyList <VirtualMachineExtensionImage> > GetAll(string location, string publisherName, string type, string filter = null, int?top = null, string orderby = null, CancellationToken cancellationToken = default) { if (location == null) { throw new ArgumentNullException(nameof(location)); } if (publisherName == null) { throw new ArgumentNullException(nameof(publisherName)); } if (type == null) { throw new ArgumentNullException(nameof(type)); } using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionImageCollection.GetAll"); scope.Start(); try { var response = _virtualMachineExtensionImagesRestClient.ListVersions(Id.SubscriptionId, location, publisherName, type, filter, top, orderby, cancellationToken); return(Response.FromValue(response.Value.Select(value => new VirtualMachineExtensionImage(Parent, value)).ToArray() as IReadOnlyList <VirtualMachineExtensionImage>, response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }