AssetsClient.GetAssetsAsync Method

Definition

List Assets in a share.

public virtual Azure.AsyncPageable<BinaryData> GetAssetsAsync (string sentShareName, string skipToken = default, string filter = default, string orderby = default, Azure.RequestContext context = default);
abstract member GetAssetsAsync : string * string * string * string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetAssetsAsync : string * string * string * string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetAssetsAsync (sentShareName As String, Optional skipToken As String = Nothing, Optional filter As String = Nothing, Optional orderby As String = Nothing, Optional context As RequestContext = Nothing) As AsyncPageable(Of BinaryData)

Parameters

sentShareName
String

The name of the sent share.

skipToken
String

The continuation token to list the next page.

filter
String

Filters the results using OData syntax.

orderby
String

Sorts the results using OData syntax.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The AsyncPageable<T> from the service containing a list of BinaryData objects. Details of the body schema for each item in the collection are in the Remarks section below.

Exceptions

sentShareName is null.

sentShareName is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call GetAssetsAsync with required parameters and parse the result.

var credential = new DefaultAzureCredential();
var client = new AssetsClient("<https://my-service.azure.com>", credential);

await foreach (var data in client.GetAssetsAsync("<sentShareName>"))
{
    JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
    Console.WriteLine(result.ToString());
}

This sample shows how to call GetAssetsAsync with all parameters, and how to parse the result.

var credential = new DefaultAzureCredential();
var client = new AssetsClient("<https://my-service.azure.com>", credential);

await foreach (var data in client.GetAssetsAsync("<sentShareName>", "<skipToken>", "<filter>", "<orderby>"))
{
    JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("id").ToString());
    Console.WriteLine(result.GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("type").ToString());
    Console.WriteLine(result.GetProperty("kind").ToString());
}

Remarks

List assets on a sent share

Below is the JSON schema for one item in the pageable response.

Response Body:

Schema for AssetListValue:

{
              id: string, # Optional. The resource id of the resource.
              name: string, # Optional. Name of the resource.
              type: string, # Optional. Type of the resource.
              kind: "AdlsGen2Account" | "BlobAccount", # Required. The types of asset.
            }

Applies to