# Policy Simulator v1 API - Class SimulatorClient (1.4.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [1.4.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.SimulatorClient)
- [1.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/1.3.0/Google.Cloud.PolicySimulator.V1.SimulatorClient)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/1.2.0/Google.Cloud.PolicySimulator.V1.SimulatorClient)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/1.1.0/Google.Cloud.PolicySimulator.V1.SimulatorClient)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/1.0.0/Google.Cloud.PolicySimulator.V1.SimulatorClient)

    public abstract class SimulatorClient

Reference documentation and code samples for the Policy Simulator v1 API class SimulatorClient.

Simulator client wrapper, for convenient use.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> SimulatorClient

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Derived Types

[SimulatorClientImpl](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.SimulatorClientImpl)

## Namespace

[Google.Cloud.PolicySimulator.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1)

## Assembly

Google.Cloud.PolicySimulator.V1.dll

## Remarks

Policy Simulator API service.

Policy Simulator is a collection of endpoints for creating, running, and
viewing a \[Replay\]\[google.cloud.policysimulator.v1.Replay\]. A
\[Replay\]\[google.cloud.policysimulator.v1.Replay\] is a type of simulation that
lets you see how your principals' access to resources might change if you
changed your IAM policy.

During a \[Replay\]\[google.cloud.policysimulator.v1.Replay\], Policy Simulator
re-evaluates, or replays, past access attempts under both the current policy
and your proposed policy, and compares those results to determine how your
principals' access might change under the proposed policy.

## Properties

### CreateReplayOperationsClient

    public virtual OperationsClient CreateReplayOperationsClient { get; }

The long-running operations client for `CreateReplay`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.OperationsClient.html` |   |

### DefaultEndpoint

    public static string DefaultEndpoint { get; }

The default endpoint for the Simulator service, which is a host of "policysimulator.googleapis.com" and a
port of 443.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### DefaultScopes

    public static IReadOnlyList<string> DefaultScopes { get; }

The default Simulator scopes.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://learn.microsoft.com/dotnet/api/system.string` |   |

**Remarks** The default Simulator scopes are:

- <https://www.googleapis.com/auth/cloud-platform>

<br />

### GrpcClient

    public virtual Simulator.SimulatorClient GrpcClient { get; }

The underlying gRPC Simulator client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Simulatorhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Simulator.SimulatorClient` |   |

### ServiceMetadata

    public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ServiceMetadata.html` |   |

## Methods

### Create()

    public static SimulatorClient Create()

Synchronously creates a [SimulatorClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.SimulatorClient) using the default credentials, endpoint and settings.
To specify custom credentials or other settings, use [SimulatorClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.SimulatorClientBuilder).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.SimulatorClient` | The created [SimulatorClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.SimulatorClient). |

### CreateAsync(CancellationToken)

    public static Task<SimulatorClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a [SimulatorClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.SimulatorClient) using the default credentials, endpoint and settings.
To specify custom credentials or other settings, use [SimulatorClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.SimulatorClientBuilder).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use while creating the client. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.SimulatorClient` | The task representing the created [SimulatorClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.SimulatorClient). |

### CreateReplay(CreateReplayRequest, CallSettings)

    public virtual Operation<Replay, ReplayOperationMetadata> CreateReplay(CreateReplayRequest request, CallSettings callSettings = null)

Creates and starts a \[Replay\]\[google.cloud.policysimulator.v1.Replay\] using
the given \[ReplayConfig\]\[google.cloud.policysimulator.v1.ReplayConfig\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.CreateReplayRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replayhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayOperationMetadata` | The RPC response. |

**Example**

    // Create client
    SimulatorClient simulatorClient = SimulatorClient.Create();
    // Initialize request argument(s)
    CreateReplayRequest request = new CreateReplayRequest
    {
        Parent = "",
        Replay = new Replay(),
    };
    // Make the request
    Operation<Replay, ReplayOperationMetadata> response = simulatorClient.CreateReplay(request);

    // Poll until the returned long-running operation is complete
    Operation<Replay, ReplayOperationMetadata> completedResponse = response.PollUntilCompleted();
    // Retrieve the operation result
    Replay result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<Replay, ReplayOperationMetadata> retrievedResponse = simulatorClient.PollOnceCreateReplay(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        Replay retrievedResult = retrievedResponse.Result;
    }

### CreateReplay(string, Replay, CallSettings)

    public virtual Operation<Replay, ReplayOperationMetadata> CreateReplay(string parent, Replay replay, CallSettings callSettings = null)

Creates and starts a \[Replay\]\[google.cloud.policysimulator.v1.Replay\] using
the given \[ReplayConfig\]\[google.cloud.policysimulator.v1.ReplayConfig\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The parent resource where this \[Replay\]\[google.cloud.policysimulator.v1.Replay\] will be created. This resource must be a project, folder, or organization with a location. Example: `projects/my-example-project/locations/global` |
| `replay` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replay` Required. The \[Replay\]\[google.cloud.policysimulator.v1.Replay\] to create. Set `Replay.ReplayConfig` to configure the replay. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replayhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayOperationMetadata` | The RPC response. |

**Example**

    // Create client
    SimulatorClient simulatorClient = SimulatorClient.Create();
    // Initialize request argument(s)
    string parent = "";
    Replay replay = new Replay();
    // Make the request
    Operation<Replay, ReplayOperationMetadata> response = simulatorClient.CreateReplay(parent, replay);

    // Poll until the returned long-running operation is complete
    Operation<Replay, ReplayOperationMetadata> completedResponse = response.PollUntilCompleted();
    // Retrieve the operation result
    Replay result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<Replay, ReplayOperationMetadata> retrievedResponse = simulatorClient.PollOnceCreateReplay(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        Replay retrievedResult = retrievedResponse.Result;
    }

### CreateReplayAsync(CreateReplayRequest, CallSettings)

    public virtual Task<Operation<Replay, ReplayOperationMetadata>> CreateReplayAsync(CreateReplayRequest request, CallSettings callSettings = null)

Creates and starts a \[Replay\]\[google.cloud.policysimulator.v1.Replay\] using
the given \[ReplayConfig\]\[google.cloud.policysimulator.v1.ReplayConfig\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.CreateReplayRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replayhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayOperationMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    SimulatorClient simulatorClient = await SimulatorClient.CreateAsync();
    // Initialize request argument(s)
    CreateReplayRequest request = new CreateReplayRequest
    {
        Parent = "",
        Replay = new Replay(),
    };
    // Make the request
    Operation<Replay, ReplayOperationMetadata> response = await simulatorClient.CreateReplayAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<Replay, ReplayOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    Replay result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<Replay, ReplayOperationMetadata> retrievedResponse = await simulatorClient.PollOnceCreateReplayAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        Replay retrievedResult = retrievedResponse.Result;
    }

### CreateReplayAsync(CreateReplayRequest, CancellationToken)

    public virtual Task<Operation<Replay, ReplayOperationMetadata>> CreateReplayAsync(CreateReplayRequest request, CancellationToken cancellationToken)

Creates and starts a \[Replay\]\[google.cloud.policysimulator.v1.Replay\] using
the given \[ReplayConfig\]\[google.cloud.policysimulator.v1.ReplayConfig\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.CreateReplayRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replayhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayOperationMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    SimulatorClient simulatorClient = await SimulatorClient.CreateAsync();
    // Initialize request argument(s)
    CreateReplayRequest request = new CreateReplayRequest
    {
        Parent = "",
        Replay = new Replay(),
    };
    // Make the request
    Operation<Replay, ReplayOperationMetadata> response = await simulatorClient.CreateReplayAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<Replay, ReplayOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    Replay result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<Replay, ReplayOperationMetadata> retrievedResponse = await simulatorClient.PollOnceCreateReplayAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        Replay retrievedResult = retrievedResponse.Result;
    }

### CreateReplayAsync(string, Replay, CallSettings)

    public virtual Task<Operation<Replay, ReplayOperationMetadata>> CreateReplayAsync(string parent, Replay replay, CallSettings callSettings = null)

Creates and starts a \[Replay\]\[google.cloud.policysimulator.v1.Replay\] using
the given \[ReplayConfig\]\[google.cloud.policysimulator.v1.ReplayConfig\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The parent resource where this \[Replay\]\[google.cloud.policysimulator.v1.Replay\] will be created. This resource must be a project, folder, or organization with a location. Example: `projects/my-example-project/locations/global` |
| `replay` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replay` Required. The \[Replay\]\[google.cloud.policysimulator.v1.Replay\] to create. Set `Replay.ReplayConfig` to configure the replay. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replayhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayOperationMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    SimulatorClient simulatorClient = await SimulatorClient.CreateAsync();
    // Initialize request argument(s)
    string parent = "";
    Replay replay = new Replay();
    // Make the request
    Operation<Replay, ReplayOperationMetadata> response = await simulatorClient.CreateReplayAsync(parent, replay);

    // Poll until the returned long-running operation is complete
    Operation<Replay, ReplayOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    Replay result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<Replay, ReplayOperationMetadata> retrievedResponse = await simulatorClient.PollOnceCreateReplayAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        Replay retrievedResult = retrievedResponse.Result;
    }

### CreateReplayAsync(string, Replay, CancellationToken)

    public virtual Task<Operation<Replay, ReplayOperationMetadata>> CreateReplayAsync(string parent, Replay replay, CancellationToken cancellationToken)

Creates and starts a \[Replay\]\[google.cloud.policysimulator.v1.Replay\] using
the given \[ReplayConfig\]\[google.cloud.policysimulator.v1.ReplayConfig\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The parent resource where this \[Replay\]\[google.cloud.policysimulator.v1.Replay\] will be created. This resource must be a project, folder, or organization with a location. Example: `projects/my-example-project/locations/global` |
| `replay` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replay` Required. The \[Replay\]\[google.cloud.policysimulator.v1.Replay\] to create. Set `Replay.ReplayConfig` to configure the replay. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replayhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayOperationMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    SimulatorClient simulatorClient = await SimulatorClient.CreateAsync();
    // Initialize request argument(s)
    string parent = "";
    Replay replay = new Replay();
    // Make the request
    Operation<Replay, ReplayOperationMetadata> response = await simulatorClient.CreateReplayAsync(parent, replay);

    // Poll until the returned long-running operation is complete
    Operation<Replay, ReplayOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    Replay result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<Replay, ReplayOperationMetadata> retrievedResponse = await simulatorClient.PollOnceCreateReplayAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        Replay retrievedResult = retrievedResponse.Result;
    }

### GetReplay(GetReplayRequest, CallSettings)

    public virtual Replay GetReplay(GetReplayRequest request, CallSettings callSettings = null)

Gets the specified \[Replay\]\[google.cloud.policysimulator.v1.Replay\]. Each
`Replay` is available for at least 7 days.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.GetReplayRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replay` | The RPC response. |

**Example**

    // Create client
    SimulatorClient simulatorClient = SimulatorClient.Create();
    // Initialize request argument(s)
    GetReplayRequest request = new GetReplayRequest
    {
        ReplayName = ReplayName.FromProjectLocationReplay("[PROJECT]", "[LOCATION]", "[REPLAY]"),
    };
    // Make the request
    Replay response = simulatorClient.GetReplay(request);

### GetReplay(ReplayName, CallSettings)

    public virtual Replay GetReplay(ReplayName name, CallSettings callSettings = null)

Gets the specified \[Replay\]\[google.cloud.policysimulator.v1.Replay\]. Each
`Replay` is available for at least 7 days.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayName` Required. The name of the \[Replay\]\[google.cloud.policysimulator.v1.Replay\] to retrieve, in the following format: `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, where `{resource-id}` is the ID of the project, folder, or organization that owns the `Replay`. Example: `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replay` | The RPC response. |

**Example**

    // Create client
    SimulatorClient simulatorClient = SimulatorClient.Create();
    // Initialize request argument(s)
    ReplayName name = ReplayName.FromProjectLocationReplay("[PROJECT]", "[LOCATION]", "[REPLAY]");
    // Make the request
    Replay response = simulatorClient.GetReplay(name);

### GetReplay(string, CallSettings)

    public virtual Replay GetReplay(string name, CallSettings callSettings = null)

Gets the specified \[Replay\]\[google.cloud.policysimulator.v1.Replay\]. Each
`Replay` is available for at least 7 days.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The name of the \[Replay\]\[google.cloud.policysimulator.v1.Replay\] to retrieve, in the following format: `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, where `{resource-id}` is the ID of the project, folder, or organization that owns the `Replay`. Example: `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replay` | The RPC response. |

**Example**

    // Create client
    SimulatorClient simulatorClient = SimulatorClient.Create();
    // Initialize request argument(s)
    string name = "projects/[PROJECT]/locations/[LOCATION]/replays/[REPLAY]";
    // Make the request
    Replay response = simulatorClient.GetReplay(name);

### GetReplayAsync(GetReplayRequest, CallSettings)

    public virtual Task<Replay> GetReplayAsync(GetReplayRequest request, CallSettings callSettings = null)

Gets the specified \[Replay\]\[google.cloud.policysimulator.v1.Replay\]. Each
`Replay` is available for at least 7 days.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.GetReplayRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replay` | A Task containing the RPC response. |

**Example**

    // Create client
    SimulatorClient simulatorClient = await SimulatorClient.CreateAsync();
    // Initialize request argument(s)
    GetReplayRequest request = new GetReplayRequest
    {
        ReplayName = ReplayName.FromProjectLocationReplay("[PROJECT]", "[LOCATION]", "[REPLAY]"),
    };
    // Make the request
    Replay response = await simulatorClient.GetReplayAsync(request);

### GetReplayAsync(GetReplayRequest, CancellationToken)

    public virtual Task<Replay> GetReplayAsync(GetReplayRequest request, CancellationToken cancellationToken)

Gets the specified \[Replay\]\[google.cloud.policysimulator.v1.Replay\]. Each
`Replay` is available for at least 7 days.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.GetReplayRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replay` | A Task containing the RPC response. |

**Example**

    // Create client
    SimulatorClient simulatorClient = await SimulatorClient.CreateAsync();
    // Initialize request argument(s)
    GetReplayRequest request = new GetReplayRequest
    {
        ReplayName = ReplayName.FromProjectLocationReplay("[PROJECT]", "[LOCATION]", "[REPLAY]"),
    };
    // Make the request
    Replay response = await simulatorClient.GetReplayAsync(request);

### GetReplayAsync(ReplayName, CallSettings)

    public virtual Task<Replay> GetReplayAsync(ReplayName name, CallSettings callSettings = null)

Gets the specified \[Replay\]\[google.cloud.policysimulator.v1.Replay\]. Each
`Replay` is available for at least 7 days.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayName` Required. The name of the \[Replay\]\[google.cloud.policysimulator.v1.Replay\] to retrieve, in the following format: `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, where `{resource-id}` is the ID of the project, folder, or organization that owns the `Replay`. Example: `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replay` | A Task containing the RPC response. |

**Example**

    // Create client
    SimulatorClient simulatorClient = await SimulatorClient.CreateAsync();
    // Initialize request argument(s)
    ReplayName name = ReplayName.FromProjectLocationReplay("[PROJECT]", "[LOCATION]", "[REPLAY]");
    // Make the request
    Replay response = await simulatorClient.GetReplayAsync(name);

### GetReplayAsync(ReplayName, CancellationToken)

    public virtual Task<Replay> GetReplayAsync(ReplayName name, CancellationToken cancellationToken)

Gets the specified \[Replay\]\[google.cloud.policysimulator.v1.Replay\]. Each
`Replay` is available for at least 7 days.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayName` Required. The name of the \[Replay\]\[google.cloud.policysimulator.v1.Replay\] to retrieve, in the following format: `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, where `{resource-id}` is the ID of the project, folder, or organization that owns the `Replay`. Example: `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replay` | A Task containing the RPC response. |

**Example**

    // Create client
    SimulatorClient simulatorClient = await SimulatorClient.CreateAsync();
    // Initialize request argument(s)
    ReplayName name = ReplayName.FromProjectLocationReplay("[PROJECT]", "[LOCATION]", "[REPLAY]");
    // Make the request
    Replay response = await simulatorClient.GetReplayAsync(name);

### GetReplayAsync(string, CallSettings)

    public virtual Task<Replay> GetReplayAsync(string name, CallSettings callSettings = null)

Gets the specified \[Replay\]\[google.cloud.policysimulator.v1.Replay\]. Each
`Replay` is available for at least 7 days.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The name of the \[Replay\]\[google.cloud.policysimulator.v1.Replay\] to retrieve, in the following format: `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, where `{resource-id}` is the ID of the project, folder, or organization that owns the `Replay`. Example: `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replay` | A Task containing the RPC response. |

**Example**

    // Create client
    SimulatorClient simulatorClient = await SimulatorClient.CreateAsync();
    // Initialize request argument(s)
    string name = "projects/[PROJECT]/locations/[LOCATION]/replays/[REPLAY]";
    // Make the request
    Replay response = await simulatorClient.GetReplayAsync(name);

### GetReplayAsync(string, CancellationToken)

    public virtual Task<Replay> GetReplayAsync(string name, CancellationToken cancellationToken)

Gets the specified \[Replay\]\[google.cloud.policysimulator.v1.Replay\]. Each
`Replay` is available for at least 7 days.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The name of the \[Replay\]\[google.cloud.policysimulator.v1.Replay\] to retrieve, in the following format: `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, where `{resource-id}` is the ID of the project, folder, or organization that owns the `Replay`. Example: `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replay` | A Task containing the RPC response. |

**Example**

    // Create client
    SimulatorClient simulatorClient = await SimulatorClient.CreateAsync();
    // Initialize request argument(s)
    string name = "projects/[PROJECT]/locations/[LOCATION]/replays/[REPLAY]";
    // Make the request
    Replay response = await simulatorClient.GetReplayAsync(name);

### ListReplayResults(ListReplayResultsRequest, CallSettings)

    public virtual PagedEnumerable<ListReplayResultsResponse, ReplayResult> ListReplayResults(ListReplayResultsRequest request, CallSettings callSettings = null)

Lists the results of running a
\[Replay\]\[google.cloud.policysimulator.v1.Replay\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ListReplayResultsRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ListReplayResultsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayResult` | A pageable sequence of [ReplayResult](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayResult) resources. |

**Example**

    // Create client
    SimulatorClient simulatorClient = SimulatorClient.Create();
    // Initialize request argument(s)
    ListReplayResultsRequest request = new ListReplayResultsRequest
    {
        ParentAsReplayName = ReplayName.FromProjectLocationReplay("[PROJECT]", "[LOCATION]", "[REPLAY]"),
    };
    // Make the request
    PagedEnumerable<ListReplayResultsResponse, ReplayResult> response = simulatorClient.ListReplayResults(request);

    // Iterate over all response items, lazily performing RPCs as required
    foreach (ReplayResult item in response)
    {
        // Do something with each item
        Console.WriteLine(item);
    }

    // Or iterate over pages (of server-defined size), performing one RPC per page
    foreach (ListReplayResultsResponse page in response.AsRawResponses())
    {
        // Do something with each page of items
        Console.WriteLine("A page of results:");
        foreach (ReplayResult item in page)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
    }

    // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    int pageSize = 10;
    Page<ReplayResult> singlePage = response.ReadPage(pageSize);
    // Do something with the page of items
    Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    foreach (ReplayResult item in singlePage)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
    // Store the pageToken, for when the next page is required.
    string nextPageToken = singlePage.NextPageToken;

### ListReplayResults(ReplayName, string, int?, CallSettings)

    public virtual PagedEnumerable<ListReplayResultsResponse, ReplayResult> ListReplayResults(ReplayName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists the results of running a
\[Replay\]\[google.cloud.policysimulator.v1.Replay\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayName` Required. The \[Replay\]\[google.cloud.policysimulator.v1.Replay\] whose results are listed, in the following format: `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` Example: `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` |
| `pageToken` | `https://learn.microsoft.com/dotnet/api/system.string` The token returned from the previous request. A value of `null` or an empty string retrieves the first page. |
| `pageSize` | `https://learn.microsoft.com/dotnet/api/system.int32` The size of page to request. The response will not be larger than this, but may be smaller. A value of `null` or `0` uses a server-defined page size. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ListReplayResultsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayResult` | A pageable sequence of [ReplayResult](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayResult) resources. |

**Example**

    // Create client
    SimulatorClient simulatorClient = SimulatorClient.Create();
    // Initialize request argument(s)
    ReplayName parent = ReplayName.FromProjectLocationReplay("[PROJECT]", "[LOCATION]", "[REPLAY]");
    // Make the request
    PagedEnumerable<ListReplayResultsResponse, ReplayResult> response = simulatorClient.ListReplayResults(parent);

    // Iterate over all response items, lazily performing RPCs as required
    foreach (ReplayResult item in response)
    {
        // Do something with each item
        Console.WriteLine(item);
    }

    // Or iterate over pages (of server-defined size), performing one RPC per page
    foreach (ListReplayResultsResponse page in response.AsRawResponses())
    {
        // Do something with each page of items
        Console.WriteLine("A page of results:");
        foreach (ReplayResult item in page)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
    }

    // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    int pageSize = 10;
    Page<ReplayResult> singlePage = response.ReadPage(pageSize);
    // Do something with the page of items
    Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    foreach (ReplayResult item in singlePage)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
    // Store the pageToken, for when the next page is required.
    string nextPageToken = singlePage.NextPageToken;

### ListReplayResults(string, string, int?, CallSettings)

    public virtual PagedEnumerable<ListReplayResultsResponse, ReplayResult> ListReplayResults(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists the results of running a
\[Replay\]\[google.cloud.policysimulator.v1.Replay\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The \[Replay\]\[google.cloud.policysimulator.v1.Replay\] whose results are listed, in the following format: `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` Example: `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` |
| `pageToken` | `https://learn.microsoft.com/dotnet/api/system.string` The token returned from the previous request. A value of `null` or an empty string retrieves the first page. |
| `pageSize` | `https://learn.microsoft.com/dotnet/api/system.int32` The size of page to request. The response will not be larger than this, but may be smaller. A value of `null` or `0` uses a server-defined page size. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ListReplayResultsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayResult` | A pageable sequence of [ReplayResult](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayResult) resources. |

**Example**

    // Create client
    SimulatorClient simulatorClient = SimulatorClient.Create();
    // Initialize request argument(s)
    string parent = "projects/[PROJECT]/locations/[LOCATION]/replays/[REPLAY]";
    // Make the request
    PagedEnumerable<ListReplayResultsResponse, ReplayResult> response = simulatorClient.ListReplayResults(parent);

    // Iterate over all response items, lazily performing RPCs as required
    foreach (ReplayResult item in response)
    {
        // Do something with each item
        Console.WriteLine(item);
    }

    // Or iterate over pages (of server-defined size), performing one RPC per page
    foreach (ListReplayResultsResponse page in response.AsRawResponses())
    {
        // Do something with each page of items
        Console.WriteLine("A page of results:");
        foreach (ReplayResult item in page)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
    }

    // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    int pageSize = 10;
    Page<ReplayResult> singlePage = response.ReadPage(pageSize);
    // Do something with the page of items
    Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    foreach (ReplayResult item in singlePage)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
    // Store the pageToken, for when the next page is required.
    string nextPageToken = singlePage.NextPageToken;

### ListReplayResultsAsync(ListReplayResultsRequest, CallSettings)

    public virtual PagedAsyncEnumerable<ListReplayResultsResponse, ReplayResult> ListReplayResultsAsync(ListReplayResultsRequest request, CallSettings callSettings = null)

Lists the results of running a
\[Replay\]\[google.cloud.policysimulator.v1.Replay\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ListReplayResultsRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedAsyncEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ListReplayResultsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayResult` | A pageable asynchronous sequence of [ReplayResult](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayResult) resources. |

**Example**

    // Create client
    SimulatorClient simulatorClient = await SimulatorClient.CreateAsync();
    // Initialize request argument(s)
    ListReplayResultsRequest request = new ListReplayResultsRequest
    {
        ParentAsReplayName = ReplayName.FromProjectLocationReplay("[PROJECT]", "[LOCATION]", "[REPLAY]"),
    };
    // Make the request
    PagedAsyncEnumerable<ListReplayResultsResponse, ReplayResult> response = simulatorClient.ListReplayResultsAsync(request);

    // Iterate over all response items, lazily performing RPCs as required
    await response.ForEachAsync((ReplayResult item) =>
    {
        // Do something with each item
        Console.WriteLine(item);
    });

    // Or iterate over pages (of server-defined size), performing one RPC per page
    await response.AsRawResponses().ForEachAsync((ListReplayResultsResponse page) =>
    {
        // Do something with each page of items
        Console.WriteLine("A page of results:");
        foreach (ReplayResult item in page)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
    });

    // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    int pageSize = 10;
    Page<ReplayResult> singlePage = await response.ReadPageAsync(pageSize);
    // Do something with the page of items
    Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    foreach (ReplayResult item in singlePage)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
    // Store the pageToken, for when the next page is required.
    string nextPageToken = singlePage.NextPageToken;

### ListReplayResultsAsync(ReplayName, string, int?, CallSettings)

    public virtual PagedAsyncEnumerable<ListReplayResultsResponse, ReplayResult> ListReplayResultsAsync(ReplayName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists the results of running a
\[Replay\]\[google.cloud.policysimulator.v1.Replay\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayName` Required. The \[Replay\]\[google.cloud.policysimulator.v1.Replay\] whose results are listed, in the following format: `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` Example: `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` |
| `pageToken` | `https://learn.microsoft.com/dotnet/api/system.string` The token returned from the previous request. A value of `null` or an empty string retrieves the first page. |
| `pageSize` | `https://learn.microsoft.com/dotnet/api/system.int32` The size of page to request. The response will not be larger than this, but may be smaller. A value of `null` or `0` uses a server-defined page size. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedAsyncEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ListReplayResultsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayResult` | A pageable asynchronous sequence of [ReplayResult](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayResult) resources. |

**Example**

    // Create client
    SimulatorClient simulatorClient = await SimulatorClient.CreateAsync();
    // Initialize request argument(s)
    ReplayName parent = ReplayName.FromProjectLocationReplay("[PROJECT]", "[LOCATION]", "[REPLAY]");
    // Make the request
    PagedAsyncEnumerable<ListReplayResultsResponse, ReplayResult> response = simulatorClient.ListReplayResultsAsync(parent);

    // Iterate over all response items, lazily performing RPCs as required
    await response.ForEachAsync((ReplayResult item) =>
    {
        // Do something with each item
        Console.WriteLine(item);
    });

    // Or iterate over pages (of server-defined size), performing one RPC per page
    await response.AsRawResponses().ForEachAsync((ListReplayResultsResponse page) =>
    {
        // Do something with each page of items
        Console.WriteLine("A page of results:");
        foreach (ReplayResult item in page)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
    });

    // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    int pageSize = 10;
    Page<ReplayResult> singlePage = await response.ReadPageAsync(pageSize);
    // Do something with the page of items
    Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    foreach (ReplayResult item in singlePage)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
    // Store the pageToken, for when the next page is required.
    string nextPageToken = singlePage.NextPageToken;

### ListReplayResultsAsync(string, string, int?, CallSettings)

    public virtual PagedAsyncEnumerable<ListReplayResultsResponse, ReplayResult> ListReplayResultsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists the results of running a
\[Replay\]\[google.cloud.policysimulator.v1.Replay\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The \[Replay\]\[google.cloud.policysimulator.v1.Replay\] whose results are listed, in the following format: `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` Example: `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` |
| `pageToken` | `https://learn.microsoft.com/dotnet/api/system.string` The token returned from the previous request. A value of `null` or an empty string retrieves the first page. |
| `pageSize` | `https://learn.microsoft.com/dotnet/api/system.int32` The size of page to request. The response will not be larger than this, but may be smaller. A value of `null` or `0` uses a server-defined page size. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedAsyncEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ListReplayResultsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayResult` | A pageable asynchronous sequence of [ReplayResult](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayResult) resources. |

**Example**

    // Create client
    SimulatorClient simulatorClient = await SimulatorClient.CreateAsync();
    // Initialize request argument(s)
    string parent = "projects/[PROJECT]/locations/[LOCATION]/replays/[REPLAY]";
    // Make the request
    PagedAsyncEnumerable<ListReplayResultsResponse, ReplayResult> response = simulatorClient.ListReplayResultsAsync(parent);

    // Iterate over all response items, lazily performing RPCs as required
    await response.ForEachAsync((ReplayResult item) =>
    {
        // Do something with each item
        Console.WriteLine(item);
    });

    // Or iterate over pages (of server-defined size), performing one RPC per page
    await response.AsRawResponses().ForEachAsync((ListReplayResultsResponse page) =>
    {
        // Do something with each page of items
        Console.WriteLine("A page of results:");
        foreach (ReplayResult item in page)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
    });

    // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    int pageSize = 10;
    Page<ReplayResult> singlePage = await response.ReadPageAsync(pageSize);
    // Do something with the page of items
    Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    foreach (ReplayResult item in singlePage)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
    // Store the pageToken, for when the next page is required.
    string nextPageToken = singlePage.NextPageToken;

### PollOnceCreateReplay(string, CallSettings)

    public virtual Operation<Replay, ReplayOperationMetadata> PollOnceCreateReplay(string operationName, CallSettings callSettings = null)

Poll an operation once, using an `operationName` from a previous invocation of `CreateReplay`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `operationName` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replayhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayOperationMetadata` | The result of polling the operation. |

### PollOnceCreateReplayAsync(string, CallSettings)

    public virtual Task<Operation<Replay, ReplayOperationMetadata>> PollOnceCreateReplayAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an `operationName` from a previous invocation of
`CreateReplay`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `operationName` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.Replayhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ReplayOperationMetadata` | A task representing the result of polling the operation. |

### ShutdownDefaultChannelsAsync()

    public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.SimulatorClient#Google_Cloud_PolicySimulator_V1_SimulatorClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.SimulatorClient#Google_Cloud_PolicySimulator_V1_SimulatorClient_CreateAsync_System_Threading_CancellationToken_). Channels which weren't automatically created are not
affected.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task representing the asynchronous shutdown operation. |

**Remarks** After calling this method, further calls to [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.SimulatorClient#Google_Cloud_PolicySimulator_V1_SimulatorClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.SimulatorClient#Google_Cloud_PolicySimulator_V1_SimulatorClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down
by another call to this method.