Escolha a permissão ou permissões marcadas como menos privilegiadas para esta API. Utilize uma permissão ou permissões com privilégios mais elevados apenas se a sua aplicação o exigir. Para obter detalhes sobre as permissões delegadas e de aplicação, veja Tipos de permissão. Para saber mais sobre estas permissões, veja a referência de permissões.
GET https://graph.microsoft.com/beta/drive/bundles
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Drives["{drive-id}"].Bundles.GetAsync();
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
bundles, err := graphClient.Drives().ByDriveId("drive-id").Bundles().Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
DriveItemCollectionResponse result = graphClient.drives().byDriveId("{drive-id}").bundles().get();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.drives.by_drive_id('drive-id').bundles.get()
Exemplo 2: Listar todos os álbuns de fotografias numa unidade
Para filtrar a lista de pacotes devolvidos de um pedido para a coleção de pacotes, pode utilizar o filter parâmetro da cadeia de consulta para especificar o tipo de pacote a devolver ao verificar a existência de uma faceta no pacote.
GET https://graph.microsoft.com/v1.0/drive/bundles?filter=bundle/album%20ne%20null
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Drives["{drive-id}"].Bundles.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "bundle/album ne null";
});
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphdrives "github.com/microsoftgraph/msgraph-sdk-go/drives"
//other-imports
)
requestFilter := "bundle/album ne null"
requestParameters := &graphdrives.ItemBundlesRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphdrives.ItemBundlesRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
bundles, err := graphClient.Drives().ByDriveId("drive-id").Bundles().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
DriveItemCollectionResponse result = graphClient.drives().byDriveId("{drive-id}").bundles().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "bundle/album ne null";
});
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.drives.item.bundles.bundles_request_builder import BundlesRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = BundlesRequestBuilder.BundlesRequestBuilderGetQueryParameters(
filter = "bundle/album ne null",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.drives.by_drive_id('drive-id').bundles.get(request_configuration = request_configuration)
O exemplo a seguir mostra a resposta. A resposta a um GET para o ponto final dos pacotes é uma matriz de recursos driveItem com o pacote.
Uma vez que todos os pacotes são itens, pode utilizar todas as operações de itens padrão nos mesmos.
Observação: o objeto de resposta mostrado aqui pode ser encurtado com fins de legibilidade.