Udostępnij za pośrednictwem


DeviceUpdateClient.GetNamesAsync(String, RequestContext) Method

Definition

Get a list of all update names that match the specified provider.

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

Parameters

provider
String

Update provider.

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

provider is null.

provider 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 GetNamesAsync with required parameters and parse the result.

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

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

Remarks

Schema for Response Body:

{
              value: [string],
              nextLink: string
            }

Schema for Response Error:

{
              error: {
                code: string,
                message: string,
                target: string,
                details: [Error],
                innererror: {
                  code: string,
                  message: string,
                  errorDetail: string,
                  innerError: InnerError
                },
                occurredDateTime: string (ISO 8601 Format)
              }
            }

Applies to