Exemplo n.º 1
0
        public virtual Pageable <DeletedVault> GetAll(CancellationToken cancellationToken = default)
        {
            Page <DeletedVault> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("DeletedVaultCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _restClient.GetAllBySubscription(cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new DeletedVault(Parent, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <DeletedVault> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("DeletedVaultCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _restClient.GetAllBySubscriptionNextPage(nextLink, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new DeletedVault(Parent, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
        public virtual Pageable <ProcessThreadInfo> GetProcessThreads(CancellationToken cancellationToken = default)
        {
            Page <ProcessThreadInfo> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _siteProcessWebAppsClientDiagnostics.CreateScope("SiteProcessResource.GetProcessThreads");
                scope.Start();
                try
                {
                    var response = _siteProcessWebAppsRestClient.ListProcessThreads(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <ProcessThreadInfo> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _siteProcessWebAppsClientDiagnostics.CreateScope("SiteProcessResource.GetProcessThreads");
                scope.Start();
                try
                {
                    var response = _siteProcessWebAppsRestClient.ListProcessThreadsNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
        public virtual Pageable <Usage> GetResourceUsage(CancellationToken cancellationToken = default)
        {
            Page <Usage> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _afdOriginGroupClientDiagnostics.CreateScope("AfdOriginGroup.GetResourceUsage");
                scope.Start();
                try
                {
                    var response = _afdOriginGroupRestClient.ListResourceUsage(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <Usage> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _afdOriginGroupClientDiagnostics.CreateScope("AfdOriginGroup.GetResourceUsage");
                scope.Start();
                try
                {
                    var response = _afdOriginGroupRestClient.ListResourceUsageNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
        public virtual Pageable <ManagedInstanceDatabaseSchemaTableColumnResource> GetAll(string filter = null, CancellationToken cancellationToken = default)
        {
            Page <ManagedInstanceDatabaseSchemaTableColumnResource> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _managedInstanceDatabaseSchemaTableColumnManagedDatabaseColumnsClientDiagnostics.CreateScope("ManagedInstanceDatabaseSchemaTableColumnCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _managedInstanceDatabaseSchemaTableColumnManagedDatabaseColumnsRestClient.ListByTable(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new ManagedInstanceDatabaseSchemaTableColumnResource(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <ManagedInstanceDatabaseSchemaTableColumnResource> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _managedInstanceDatabaseSchemaTableColumnManagedDatabaseColumnsClientDiagnostics.CreateScope("ManagedInstanceDatabaseSchemaTableColumnCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _managedInstanceDatabaseSchemaTableColumnManagedDatabaseColumnsRestClient.ListByTableNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new ManagedInstanceDatabaseSchemaTableColumnResource(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
        public virtual Pageable <MhsmPrivateEndpointConnection> GetAll(CancellationToken cancellationToken = default)
        {
            Page <MhsmPrivateEndpointConnection> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("MhsmPrivateEndpointConnectionCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _mHSMPrivateEndpointConnectionsRestClient.ListByResource(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new MhsmPrivateEndpointConnection(Parent, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <MhsmPrivateEndpointConnection> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("MhsmPrivateEndpointConnectionCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _mHSMPrivateEndpointConnectionsRestClient.ListByResourceNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new MhsmPrivateEndpointConnection(Parent, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
Exemplo n.º 6
0
        public virtual Pageable <RoleInstance> GetAll(InstanceViewTypes?expand = null, CancellationToken cancellationToken = default)
        {
            Page <RoleInstance> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("RoleInstanceCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _cloudServiceRoleInstancesRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new RoleInstance(Parent, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <RoleInstance> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("RoleInstanceCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _cloudServiceRoleInstancesRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new RoleInstance(Parent, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
        /// <summary> Get a list of all rendering sessions. </summary>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        public virtual Pageable <RenderingSession> GetSessions(CancellationToken cancellationToken = default)
        {
            Page <RenderingSession> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(GetSessions)}");
                scope.Start();
                try
                {
                    var result = _restClient.ListSessions(_accountId, cancellationToken);
                    return(Page.FromValues(result.Value.Sessions, result.Value.NextLink, result.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <RenderingSession> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(GetSessions)}");
                scope.Start();
                try
                {
                    var result = _restClient.ListSessionsNextPage(nextLink, _accountId, cancellationToken);
                    return(Page.FromValues(result.Value.Sessions, result.Value.NextLink, result.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
Exemplo n.º 8
0
        public virtual Pageable <BatchDeploymentResource> GetAll(string orderBy = null, int?top = null, string skip = null, CancellationToken cancellationToken = default)
        {
            Page <BatchDeploymentResource> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _batchDeploymentClientDiagnostics.CreateScope("BatchDeploymentCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _batchDeploymentRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new BatchDeploymentResource(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <BatchDeploymentResource> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _batchDeploymentClientDiagnostics.CreateScope("BatchDeploymentCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _batchDeploymentRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new BatchDeploymentResource(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
Exemplo n.º 9
0
        public virtual Pageable <HciClusterResource> GetHciClusters(CancellationToken cancellationToken = default)
        {
            Page <HciClusterResource> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = HciClusterClustersClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetHciClusters");
                scope.Start();
                try
                {
                    var response = HciClusterClustersRestClient.ListBySubscription(Id.SubscriptionId, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new HciClusterResource(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <HciClusterResource> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = HciClusterClustersClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetHciClusters");
                scope.Start();
                try
                {
                    var response = HciClusterClustersRestClient.ListBySubscriptionNextPage(nextLink, Id.SubscriptionId, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new HciClusterResource(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
Exemplo n.º 10
0
        public virtual Pageable <OrderItemResource> GetAll(string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default)
        {
            Page <OrderItemResource> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _orderItemResourceClientDiagnostics.CreateScope("OrderItemResourceCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _orderItemResourceRestClient.ListOrderItemsAtResourceGroupLevel(Id.SubscriptionId, Id.ResourceGroupName, filter, expand, skipToken, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new OrderItemResource(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <OrderItemResource> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _orderItemResourceClientDiagnostics.CreateScope("OrderItemResourceCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _orderItemResourceRestClient.ListOrderItemsAtResourceGroupLevelNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, filter, expand, skipToken, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new OrderItemResource(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
Exemplo n.º 11
0
        public virtual Pageable <ApplicationGatewayPrivateLinkResource> GetApplicationGatewayPrivateLinkResources(CancellationToken cancellationToken = default)
        {
            Page <ApplicationGatewayPrivateLinkResource> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("ApplicationGateway.GetApplicationGatewayPrivateLinkResources");
                scope.Start();
                try
                {
                    var response = _applicationGatewayPrivateLinkResourcesRestClient.GetAll(Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <ApplicationGatewayPrivateLinkResource> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("ApplicationGateway.GetApplicationGatewayPrivateLinkResources");
                scope.Start();
                try
                {
                    var response = _applicationGatewayPrivateLinkResourcesRestClient.GetAllNextPage(nextLink, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
Exemplo n.º 12
0
        public virtual Pageable <VirtualMachineScaleSetVirtualMachineRunCommandResource> GetAll(string expand = null, CancellationToken cancellationToken = default)
        {
            Page <VirtualMachineScaleSetVirtualMachineRunCommandResource> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _virtualMachineScaleSetVirtualMachineRunCommandVirtualMachineScaleSetVMRunCommandsClientDiagnostics.CreateScope("VirtualMachineScaleSetVirtualMachineRunCommandCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _virtualMachineScaleSetVirtualMachineRunCommandVirtualMachineScaleSetVMRunCommandsRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, expand, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new VirtualMachineScaleSetVirtualMachineRunCommandResource(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <VirtualMachineScaleSetVirtualMachineRunCommandResource> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _virtualMachineScaleSetVirtualMachineRunCommandVirtualMachineScaleSetVMRunCommandsClientDiagnostics.CreateScope("VirtualMachineScaleSetVirtualMachineRunCommandCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _virtualMachineScaleSetVirtualMachineRunCommandVirtualMachineScaleSetVMRunCommandsRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, expand, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new VirtualMachineScaleSetVirtualMachineRunCommandResource(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
        public virtual Pageable <SiteConfigAppsetting> GetAll(CancellationToken cancellationToken = default)
        {
            Page <SiteConfigAppsetting> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _siteConfigAppsettingWebAppsClientDiagnostics.CreateScope("SiteConfigAppsettingCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _siteConfigAppsettingWebAppsRestClient.GetAppSettingsKeyVaultReferences(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new SiteConfigAppsetting(ArmClient, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <SiteConfigAppsetting> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _siteConfigAppsettingWebAppsClientDiagnostics.CreateScope("SiteConfigAppsettingCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _siteConfigAppsettingWebAppsRestClient.GetAppSettingsKeyVaultReferencesNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new SiteConfigAppsetting(ArmClient, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
Exemplo n.º 14
0
        /// <summary>
        /// List all entities that descend from a management group.
        /// .
        /// </summary>
        /// <param name="skiptoken">
        /// Page continuation token is only used if a previous operation returned a partial result.
        /// If a previous response contains a nextLink element, the value of the nextLink element will include a token parameter that specifies a starting point to use for subsequent calls.
        /// .
        /// </param>
        /// <param name="top"> Number of elements to return when retrieving results. Passing this in will override $skipToken. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        public virtual Pageable <DescendantInfo> GetDescendants(string skiptoken = null, int?top = null, CancellationToken cancellationToken = default)
        {
            Page <DescendantInfo> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("ManagementGroup.GetDescendants");
                scope.Start();
                try
                {
                    var response = _restClient.GetDescendants(Id.Name, skiptoken, top, cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <DescendantInfo> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("ManagementGroup.GetDescendants");
                scope.Start();
                try
                {
                    var response = _restClient.GetDescendantsNextPage(nextLink, Id.Name, skiptoken, top, cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
Exemplo n.º 15
0
        public virtual Pageable <ExpressRouteCircuitPeering> GetAll(CancellationToken cancellationToken = default)
        {
            Page <ExpressRouteCircuitPeering> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _expressRouteCircuitPeeringClientDiagnostics.CreateScope("ExpressRouteCircuitPeeringCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _expressRouteCircuitPeeringRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new ExpressRouteCircuitPeering(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <ExpressRouteCircuitPeering> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _expressRouteCircuitPeeringClientDiagnostics.CreateScope("ExpressRouteCircuitPeeringCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _expressRouteCircuitPeeringRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new ExpressRouteCircuitPeering(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
        public virtual Pageable <SyncFullSchemaProperties> GetMemberSchemas(CancellationToken cancellationToken = default)
        {
            Page <SyncFullSchemaProperties> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _syncMemberClientDiagnostics.CreateScope("SyncMember.GetMemberSchemas");
                scope.Start();
                try
                {
                    var response = _syncMemberRestClient.ListMemberSchemas(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <SyncFullSchemaProperties> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _syncMemberClientDiagnostics.CreateScope("SyncMember.GetMemberSchemas");
                scope.Start();
                try
                {
                    var response = _syncMemberRestClient.ListMemberSchemasNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
 /// <summary>
 /// Gets a list of tables from the storage account.
 /// </summary>
 /// <param name="select">Returns the desired properties of an entity from the set. </param>
 /// <param name="filter">Returns only tables or entities that satisfy the specified filter.</param>
 /// <param name="top">Returns only the top n tables or entities from the set.</param>
 /// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param>
 /// <returns></returns>
 public virtual Pageable <TableItem> GetTables(string select = null, string filter = null, int?top = null, CancellationToken cancellationToken = default)
 {
     return(PageableHelpers.CreateEnumerable(_ =>
     {
         var response = _tableOperations.RestClient.Query(
             null,
             new QueryOptions()
         {
             Filter = filter, Select = select, Top = top, Format = _format
         },
             cancellationToken);
         return Page.FromValues(response.Value.Value, response.Headers.XMsContinuationNextTableName, response.GetRawResponse());
     }, (nextLink, _) =>
     {
         var response = _tableOperations.RestClient.Query(
             null,
             new QueryOptions()
         {
             Filter = filter, Select = select, Top = top, Format = _format, NextTableName = nextLink
         },
             cancellationToken);
         return Page.FromValues(response.Value.Value, response.Headers.XMsContinuationNextTableName, response.GetRawResponse());
     }));
 }
Exemplo n.º 18
0
        public virtual Pageable <ADGroup> List(string filter = null, CancellationToken cancellationToken = default)
        {
            Page <ADGroup> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("GroupsOperations.List");
                scope.Start();
                try
                {
                    var response = RestClient.List(filter, cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.OdataNextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <ADGroup> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("GroupsOperations.List");
                scope.Start();
                try
                {
                    var response = RestClient.ListNext(nextLink, cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.OdataNextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
        public virtual Pageable <DataWarehouseUserActivitiesResource> GetAll(CancellationToken cancellationToken = default)
        {
            Page <DataWarehouseUserActivitiesResource> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _dataWarehouseUserActivitiesDataWarehouseUserActivitiesClientDiagnostics.CreateScope("DataWarehouseUserActivitiesCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _dataWarehouseUserActivitiesDataWarehouseUserActivitiesRestClient.ListByDatabase(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new DataWarehouseUserActivitiesResource(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <DataWarehouseUserActivitiesResource> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _dataWarehouseUserActivitiesDataWarehouseUserActivitiesClientDiagnostics.CreateScope("DataWarehouseUserActivitiesCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _dataWarehouseUserActivitiesDataWarehouseUserActivitiesRestClient.ListByDatabaseNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new DataWarehouseUserActivitiesResource(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
        public virtual Pageable <ServerJobAgentJobExecution> GetJobTargetExecutions(Guid jobExecutionId, DateTimeOffset?createTimeMin = null, DateTimeOffset?createTimeMax = null, DateTimeOffset?endTimeMin = null, DateTimeOffset?endTimeMax = null, bool?isActive = null, int?skip = null, int?top = null, CancellationToken cancellationToken = default)
        {
            Page <ServerJobAgentJobExecution> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _serverJobAgentJobExecutionStepTargetJobTargetExecutionsClientDiagnostics.CreateScope("ServerJobAgentJobExecutionCollection.GetJobTargetExecutions");
                scope.Start();
                try
                {
                    var response = _serverJobAgentJobExecutionStepTargetJobTargetExecutionsRestClient.ListByJobExecution(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, jobExecutionId, createTimeMin, createTimeMax, endTimeMin, endTimeMax, isActive, skip, top, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new ServerJobAgentJobExecution(ArmClient, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <ServerJobAgentJobExecution> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _serverJobAgentJobExecutionStepTargetJobTargetExecutionsClientDiagnostics.CreateScope("ServerJobAgentJobExecutionCollection.GetJobTargetExecutions");
                scope.Start();
                try
                {
                    var response = _serverJobAgentJobExecutionStepTargetJobTargetExecutionsRestClient.ListByJobExecutionNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, jobExecutionId, createTimeMin, createTimeMax, endTimeMin, endTimeMax, isActive, skip, top, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new ServerJobAgentJobExecution(ArmClient, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
        public virtual Pageable <DeploymentScript> ListBySubscription(CancellationToken cancellationToken = default)
        {
            Page <DeploymentScript> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("DeploymentScriptsOperations.ListBySubscription");
                scope.Start();
                try
                {
                    var response = RestClient.ListBySubscription(cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <DeploymentScript> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("DeploymentScriptsOperations.ListBySubscription");
                scope.Start();
                try
                {
                    var response = RestClient.ListBySubscriptionNextPage(nextLink, cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
Exemplo n.º 22
0
        public virtual Pageable <ServiceEndpointPolicy> List(CancellationToken cancellationToken = default)
        {
            Page <ServiceEndpointPolicy> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("ServiceEndpointPoliciesClient.List");
                scope.Start();
                try
                {
                    var response = RestClient.List(cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <ServiceEndpointPolicy> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("ServiceEndpointPoliciesClient.List");
                scope.Start();
                try
                {
                    var response = RestClient.ListNextPage(nextLink, cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
Exemplo n.º 23
0
        /// <summary>
        /// List management groups for the authenticated user.
        /// .
        /// </summary>
        /// <param name="cacheControl"> Indicates whether the request should utilize any caches. Populate the header with &apos;no-cache&apos; value to bypass existing caches. </param>
        /// <param name="skiptoken">
        /// Page continuation token is only used if a previous operation returned a partial result.
        /// If a previous response contains a nextLink element, the value of the nextLink element will include a token parameter that specifies a starting point to use for subsequent calls.
        /// .
        /// </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        public virtual Pageable <ManagementGroupInfo> GetAll(string cacheControl = null, string skiptoken = null, CancellationToken cancellationToken = default)
        {
            Page <ManagementGroupInfo> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("ManagementGroupContainer.GetAll");
                scope.Start();
                try
                {
                    var response = _restClient.List(cacheControl, skiptoken, cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(d => new ManagementGroupInfo(this, d)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <ManagementGroupInfo> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("ManagementGroupContainer.GetAll");
                scope.Start();
                try
                {
                    var response = _restClient.ListNextPage(nextLink, cacheControl, skiptoken, cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(d => new ManagementGroupInfo(this, d)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
Exemplo n.º 24
0
        public virtual Pageable <AppServiceUsage> GetMultiRoleUsages(CancellationToken cancellationToken = default)
        {
            Page <AppServiceUsage> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _hostingEnvironmentMultiRolePoolAppServiceEnvironmentsClientDiagnostics.CreateScope("HostingEnvironmentMultiRolePoolResource.GetMultiRoleUsages");
                scope.Start();
                try
                {
                    var response = _hostingEnvironmentMultiRolePoolAppServiceEnvironmentsRestClient.ListMultiRoleUsages(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <AppServiceUsage> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _hostingEnvironmentMultiRolePoolAppServiceEnvironmentsClientDiagnostics.CreateScope("HostingEnvironmentMultiRolePoolResource.GetMultiRoleUsages");
                scope.Start();
                try
                {
                    var response = _hostingEnvironmentMultiRolePoolAppServiceEnvironmentsRestClient.ListMultiRoleUsagesNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
        public virtual Pageable <SiteSlotDiagnosticAnalysis> GetAll(CancellationToken cancellationToken = default)
        {
            Page <SiteSlotDiagnosticAnalysis> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("SiteSlotDiagnosticAnalysisCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _diagnosticsRestClient.ListSiteAnalysesSlot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new SiteSlotDiagnosticAnalysis(Parent, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <SiteSlotDiagnosticAnalysis> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("SiteSlotDiagnosticAnalysisCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _diagnosticsRestClient.ListSiteAnalysesSlotNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new SiteSlotDiagnosticAnalysis(Parent, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
        public virtual Pageable <AzureWebCategory> GetAll(CancellationToken cancellationToken = default)
        {
            Page <AzureWebCategory> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _azureWebCategoryWebCategoriesClientDiagnostics.CreateScope("AzureWebCategoryCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _azureWebCategoryWebCategoriesRestClient.ListBySubscription(Id.SubscriptionId, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new AzureWebCategory(ArmClient, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <AzureWebCategory> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _azureWebCategoryWebCategoriesClientDiagnostics.CreateScope("AzureWebCategoryCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _azureWebCategoryWebCategoriesRestClient.ListBySubscriptionNextPage(nextLink, Id.SubscriptionId, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new AzureWebCategory(ArmClient, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
        public virtual Pageable <SecurityPartnerProviderResource> GetAll(CancellationToken cancellationToken = default)
        {
            Page <SecurityPartnerProviderResource> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _securityPartnerProviderClientDiagnostics.CreateScope("SecurityPartnerProviderCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _securityPartnerProviderRestClient.ListByResourceGroup(Id.SubscriptionId, Id.ResourceGroupName, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new SecurityPartnerProviderResource(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <SecurityPartnerProviderResource> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _securityPartnerProviderClientDiagnostics.CreateScope("SecurityPartnerProviderCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _securityPartnerProviderRestClient.ListByResourceGroupNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new SecurityPartnerProviderResource(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
Exemplo n.º 28
0
        public virtual Pageable <VpnGateway> GetAll(CancellationToken cancellationToken = default)
        {
            Page <VpnGateway> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("VpnGatewayCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _restClient.GetAllByResourceGroup(Id.ResourceGroupName, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new VpnGateway(Parent, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <VpnGateway> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("VpnGatewayCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _restClient.GetAllByResourceGroupNextPage(nextLink, Id.ResourceGroupName, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new VpnGateway(Parent, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
Exemplo n.º 29
0
        public virtual Pageable <ResourceGroup> GetAll(string filter = null, int?top = null, CancellationToken cancellationToken = default)
        {
            Page <ResourceGroup> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _resourceGroupClientDiagnostics.CreateScope("ResourceGroupCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _resourceGroupRestClient.List(Id.SubscriptionId, filter, top, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new ResourceGroup(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <ResourceGroup> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _resourceGroupClientDiagnostics.CreateScope("ResourceGroupCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _resourceGroupRestClient.ListNextPage(nextLink, Id.SubscriptionId, filter, top, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value.Select(value => new ResourceGroup(Client, value)), response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
Exemplo n.º 30
0
        public virtual Pageable <DeploymentOperation> GetDeploymentOperations(int?top = null, CancellationToken cancellationToken = default)
        {
            Page <DeploymentOperation> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _deploymentOperationsClientDiagnostics.CreateScope("Deployment.GetDeploymentOperations");
                scope.Start();
                try
                {
                    var response = _deploymentOperationsRestClient.ListAtScope(Id.Parent, Id.Name, top, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            Page <DeploymentOperation> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                using var scope = _deploymentOperationsClientDiagnostics.CreateScope("Deployment.GetDeploymentOperations");
                scope.Start();
                try
                {
                    var response = _deploymentOperationsRestClient.ListAtScopeNextPage(nextLink, Id.Parent, Id.Name, top, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }