DeploymentEnvironmentsClient.GetEnvironmentTypesAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetEnvironmentTypesAsync(String, CancellationToken) |
Lists all environment types configured for a project. |
GetEnvironmentTypesAsync(String, Nullable<Int32>, RequestContext) |
[Protocol Method] Lists all environment types configured for a project.
|
GetEnvironmentTypesAsync(String, RequestContext) |
[Protocol Method] Lists all environment types configured for a project.
|
GetEnvironmentTypesAsync(String, CancellationToken)
Lists all environment types configured for a project.
public virtual Azure.AsyncPageable<Azure.Developer.DevCenter.Models.DevCenterEnvironmentType> GetEnvironmentTypesAsync (string projectName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetEnvironmentTypesAsync : string * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Developer.DevCenter.Models.DevCenterEnvironmentType>
override this.GetEnvironmentTypesAsync : string * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Developer.DevCenter.Models.DevCenterEnvironmentType>
Public Overridable Function GetEnvironmentTypesAsync (projectName As String, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of DevCenterEnvironmentType)
Parameters
- projectName
- String
The DevCenter Project upon which to execute operations.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
projectName
is null.
projectName
is an empty string, and was expected to be non-empty.
Examples
This sample shows how to call GetEnvironmentTypesAsync.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeploymentEnvironmentsClient client = new DeploymentEnvironmentsClient(endpoint, credential);
await foreach (DevCenterEnvironmentType item in client.GetEnvironmentTypesAsync("<projectName>"))
{
}
This sample shows how to call GetEnvironmentTypesAsync with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeploymentEnvironmentsClient client = new DeploymentEnvironmentsClient(endpoint, credential);
await foreach (DevCenterEnvironmentType item in client.GetEnvironmentTypesAsync("<projectName>"))
{
}
Applies to
GetEnvironmentTypesAsync(String, Nullable<Int32>, RequestContext)
[Protocol Method] Lists all environment types configured for a project.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.AsyncPageable<BinaryData> GetEnvironmentTypesAsync (string projectName, int? maxCount, Azure.RequestContext context);
abstract member GetEnvironmentTypesAsync : string * Nullable<int> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetEnvironmentTypesAsync : string * Nullable<int> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetEnvironmentTypesAsync (projectName As String, maxCount As Nullable(Of Integer), context As RequestContext) As AsyncPageable(Of BinaryData)
Parameters
- projectName
- String
The DevCenter Project upon which to execute operations.
The maximum number of resources to return from the operation. Example: 'top=10'.
- 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
projectName
is null.
projectName
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 GetEnvironmentTypesAsync and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeploymentEnvironmentsClient client = new DeploymentEnvironmentsClient(endpoint, credential);
await foreach (BinaryData item in client.GetEnvironmentTypesAsync("<projectName>", null, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("deploymentTargetId").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
}
This sample shows how to call GetEnvironmentTypesAsync with all parameters and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeploymentEnvironmentsClient client = new DeploymentEnvironmentsClient(endpoint, credential);
await foreach (BinaryData item in client.GetEnvironmentTypesAsync("<projectName>", 1234, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("deploymentTargetId").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
}
Applies to
GetEnvironmentTypesAsync(String, RequestContext)
[Protocol Method] Lists all environment types configured for a project.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetEnvironmentTypesAsync(String, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.AsyncPageable<BinaryData> GetEnvironmentTypesAsync (string projectName, Azure.RequestContext context);
abstract member GetEnvironmentTypesAsync : string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetEnvironmentTypesAsync : string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetEnvironmentTypesAsync (projectName As String, context As RequestContext) As AsyncPageable(Of BinaryData)
Parameters
- projectName
- String
The DevCenter Project upon which to execute operations.
- 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
projectName
is null.
projectName
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 GetEnvironmentTypesAsync and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeploymentEnvironmentsClient client = new DeploymentEnvironmentsClient(endpoint, credential);
await foreach (BinaryData item in client.GetEnvironmentTypesAsync("<projectName>", null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("deploymentTargetId").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
}
This sample shows how to call GetEnvironmentTypesAsync with all parameters and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeploymentEnvironmentsClient client = new DeploymentEnvironmentsClient(endpoint, credential);
await foreach (BinaryData item in client.GetEnvironmentTypesAsync("<projectName>", null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("deploymentTargetId").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
}
Applies to
Azure SDK for .NET