你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

OAuthProviders.GetOAuthProviders 方法

定义

返回 oauthProvider 资源的分页列表。

public virtual Azure.Pageable<BinaryData> GetOAuthProviders (System.Collections.Generic.IEnumerable<string> providerIds = default, System.Collections.Generic.IEnumerable<string> names = default, System.Collections.Generic.IEnumerable<string> propertyFilters = default, System.Collections.Generic.IEnumerable<string> statuses = default, DateTimeOffset? minCreatedDateTime = default, DateTimeOffset? maxCreatedDateTime = default, DateTimeOffset? minLastModifiedDateTime = default, DateTimeOffset? maxLastModifiedDateTime = default, int? maxPageSize = default, string skipToken = default, Azure.RequestContext context = default);
abstract member GetOAuthProviders : seq<string> * seq<string> * seq<string> * seq<string> * Nullable<DateTimeOffset> * Nullable<DateTimeOffset> * Nullable<DateTimeOffset> * Nullable<DateTimeOffset> * Nullable<int> * string * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetOAuthProviders : seq<string> * seq<string> * seq<string> * seq<string> * Nullable<DateTimeOffset> * Nullable<DateTimeOffset> * Nullable<DateTimeOffset> * Nullable<DateTimeOffset> * Nullable<int> * string * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetOAuthProviders (Optional providerIds As IEnumerable(Of String) = Nothing, Optional names As IEnumerable(Of String) = Nothing, Optional propertyFilters As IEnumerable(Of String) = Nothing, Optional statuses As IEnumerable(Of String) = Nothing, Optional minCreatedDateTime As Nullable(Of DateTimeOffset) = Nothing, Optional maxCreatedDateTime As Nullable(Of DateTimeOffset) = Nothing, Optional minLastModifiedDateTime As Nullable(Of DateTimeOffset) = Nothing, Optional maxLastModifiedDateTime As Nullable(Of DateTimeOffset) = Nothing, Optional maxPageSize As Nullable(Of Integer) = Nothing, Optional skipToken As String = Nothing, Optional context As RequestContext = Nothing) As Pageable(Of BinaryData)

参数

providerIds
IEnumerable<String>

资源的 ID。

names
IEnumerable<String>

资源的名称。

propertyFilters
IEnumerable<String>

筛选 Properties 对象中的键值对。 例如 “{testKey} eq {testValue}”。

statuses
IEnumerable<String>

资源的状态。

minCreatedDateTime
Nullable<DateTimeOffset>

资源的最小创建日期 (非独占) 。

maxCreatedDateTime
Nullable<DateTimeOffset>

资源的最大创建日期 (非独占) 。

minLastModifiedDateTime
Nullable<DateTimeOffset>

资源的上次修改日期的最小 ((含) )。

maxLastModifiedDateTime
Nullable<DateTimeOffset>

资源的上次修改日期上限 (非独占) 。

maxPageSize
Nullable<Int32>

(非独占) 所需的项目数上限。 最小值 = 10,最大值 = 1000,默认值 = 50。

skipToken
String

跳过用于获取下一组结果的令牌。

context
RequestContext

请求上下文,可以基于每个调用替代客户端管道的默认行为。

返回

Pageable<T>包含对象列表的服务中的 BinaryData 。 集合中每个项的正文架构的详细信息,请参阅下面的“备注”部分。

例外

服务返回了非成功状态代码。

示例

此示例演示如何调用 GetOAuthProviders 并分析结果。

var credential = new DefaultAzureCredential();
var client = new FarmBeatsClient(credential).GetOAuthProvidersClient(<2022-11-01-preview>);

foreach (var data in client.GetOAuthProviders())
{
    JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
    Console.WriteLine(result.ToString());
}

此示例演示如何使用所有参数调用 GetOAuthProviders,以及如何分析结果。

var credential = new DefaultAzureCredential();
var client = new FarmBeatsClient(credential).GetOAuthProvidersClient(<2022-11-01-preview>);

foreach (var data in client.GetOAuthProviders(new String[]{"<providerIds>"}, new String[]{"<names>"}, new String[]{"<propertyFilters>"}, new String[]{"<statuses>"}, DateTimeOffset.UtcNow, DateTimeOffset.UtcNow, DateTimeOffset.UtcNow, DateTimeOffset.UtcNow, 1234, "<skipToken>"))
{
    JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("appId").ToString());
    Console.WriteLine(result.GetProperty("appSecret").ToString());
    Console.WriteLine(result.GetProperty("apiKey").ToString());
    Console.WriteLine(result.GetProperty("isProductionApp").ToString());
    Console.WriteLine(result.GetProperty("id").ToString());
    Console.WriteLine(result.GetProperty("eTag").ToString());
    Console.WriteLine(result.GetProperty("createdDateTime").ToString());
    Console.WriteLine(result.GetProperty("modifiedDateTime").ToString());
    Console.WriteLine(result.GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("description").ToString());
    Console.WriteLine(result.GetProperty("createdBy").ToString());
    Console.WriteLine(result.GetProperty("modifiedBy").ToString());
    Console.WriteLine(result.GetProperty("properties").GetProperty("<test>").ToString());
}

注解

下面是可分页响应中一项的 JSON 架构。

响应正文:

OAuthProviderListResponseValue架构:

{
  appId: string, # Optional. OAuth App Id for given OAuth Provider.
  appSecret: string, # Optional. OAuth App secret for given Provider.
Note: Won't be sent in response.
  apiKey: string, # Optional. OAuth Api key for given Provider.
Note: currently Applicable to Climate provider. Won't be sent in response.
  isProductionApp: boolean, # Optional. An optional flag to determine if the App is ready to be used for Production scenarios in the provider side or not. (Default value: false)
Note: Currently applicable for JohnDeere.
  id: string, # Optional. Unique OAuth provider ID.
  eTag: string, # Optional. The ETag value to implement optimistic concurrency.
  createdDateTime: string (ISO 8601 Format), # Optional. Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ.
  modifiedDateTime: string (ISO 8601 Format), # Optional. Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ.
  name: string, # Optional. Name to identify resource.
  description: string, # Optional. Textual description of the resource.
  createdBy: string, # Optional. Created by user/tenant id.
  modifiedBy: string, # Optional. Modified by user/tenant id.
  properties: Dictionary<string, any>, # Optional. A collection of key value pairs that belongs to the resource.
Each pair must not have a key greater than 50 characters
and must not have a value greater than 150 characters.
Note: A maximum of 25 key value pairs can be provided for a resource and
only string, numeral and datetime (yyyy-MM-ddTHH:mm:ssZ) values are supported.
}

适用于