Google Cloud Asset Inventory v1 API - Class AssetServiceClient (3.8.0)

public abstract class AssetServiceClient

Reference documentation and code samples for the Google Cloud Asset Inventory v1 API class AssetServiceClient.

AssetService client wrapper, for convenient use.

Inheritance

object > AssetServiceClient

Derived Types

Namespace

Google.Cloud.Asset.V1

Assembly

Google.Cloud.Asset.V1.dll

Remarks

Asset service definition.

Properties

AnalyzeIamPolicyLongrunningOperationsClient

public virtual OperationsClient AnalyzeIamPolicyLongrunningOperationsClient { get; }

The long-running operations client for AnalyzeIamPolicyLongrunning.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default AssetService scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

The default AssetService scopes are:

ExportAssetsOperationsClient

public virtual OperationsClient ExportAssetsOperationsClient { get; }

The long-running operations client for ExportAssets.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual AssetService.AssetServiceClient GrpcClient { get; }

The underlying gRPC AssetService client

Property Value
TypeDescription
AssetServiceAssetServiceClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

AnalyzeIamPolicy(AnalyzeIamPolicyRequest, CallSettings)

public virtual AnalyzeIamPolicyResponse AnalyzeIamPolicy(AnalyzeIamPolicyRequest request, CallSettings callSettings = null)

Analyzes IAM policies to answer which identities have what accesses on which resources.

Parameters
NameDescription
requestAnalyzeIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AnalyzeIamPolicyResponse

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
AnalyzeIamPolicyRequest request = new AnalyzeIamPolicyRequest
{
    AnalysisQuery = new IamPolicyAnalysisQuery(),
    ExecutionTimeout = new Duration(),
    SavedAnalysisQuery = "",
};
// Make the request
AnalyzeIamPolicyResponse response = assetServiceClient.AnalyzeIamPolicy(request);

AnalyzeIamPolicyAsync(AnalyzeIamPolicyRequest, CallSettings)

public virtual Task<AnalyzeIamPolicyResponse> AnalyzeIamPolicyAsync(AnalyzeIamPolicyRequest request, CallSettings callSettings = null)

Analyzes IAM policies to answer which identities have what accesses on which resources.

Parameters
NameDescription
requestAnalyzeIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskAnalyzeIamPolicyResponse

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
AnalyzeIamPolicyRequest request = new AnalyzeIamPolicyRequest
{
    AnalysisQuery = new IamPolicyAnalysisQuery(),
    ExecutionTimeout = new Duration(),
    SavedAnalysisQuery = "",
};
// Make the request
AnalyzeIamPolicyResponse response = await assetServiceClient.AnalyzeIamPolicyAsync(request);

AnalyzeIamPolicyAsync(AnalyzeIamPolicyRequest, CancellationToken)

public virtual Task<AnalyzeIamPolicyResponse> AnalyzeIamPolicyAsync(AnalyzeIamPolicyRequest request, CancellationToken cancellationToken)

Analyzes IAM policies to answer which identities have what accesses on which resources.

Parameters
NameDescription
requestAnalyzeIamPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskAnalyzeIamPolicyResponse

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
AnalyzeIamPolicyRequest request = new AnalyzeIamPolicyRequest
{
    AnalysisQuery = new IamPolicyAnalysisQuery(),
    ExecutionTimeout = new Duration(),
    SavedAnalysisQuery = "",
};
// Make the request
AnalyzeIamPolicyResponse response = await assetServiceClient.AnalyzeIamPolicyAsync(request);

AnalyzeIamPolicyLongrunning(AnalyzeIamPolicyLongrunningRequest, CallSettings)

public virtual Operation<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata> AnalyzeIamPolicyLongrunning(AnalyzeIamPolicyLongrunningRequest request, CallSettings callSettings = null)

Analyzes IAM policies asynchronously to answer which identities have what accesses on which resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON format that represents a [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method implements the [google.longrunning.Operation][google.longrunning.Operation], which allows you to track the operation status. We recommend intervals of at least 2 seconds with exponential backoff retry to poll the operation result. The metadata contains the metadata for the long-running operation.

Parameters
NameDescription
requestAnalyzeIamPolicyLongrunningRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationAnalyzeIamPolicyLongrunningResponseAnalyzeIamPolicyLongrunningMetadata

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
AnalyzeIamPolicyLongrunningRequest request = new AnalyzeIamPolicyLongrunningRequest
{
    AnalysisQuery = new IamPolicyAnalysisQuery(),
    OutputConfig = new IamPolicyAnalysisOutputConfig(),
    SavedAnalysisQuery = "",
};
// Make the request
Operation<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata> response = assetServiceClient.AnalyzeIamPolicyLongrunning(request);

// Poll until the returned long-running operation is complete
Operation<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
AnalyzeIamPolicyLongrunningResponse 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<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata> retrievedResponse = assetServiceClient.PollOnceAnalyzeIamPolicyLongrunning(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AnalyzeIamPolicyLongrunningResponse retrievedResult = retrievedResponse.Result;
}

AnalyzeIamPolicyLongrunningAsync(AnalyzeIamPolicyLongrunningRequest, CallSettings)

public virtual Task<Operation<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata>> AnalyzeIamPolicyLongrunningAsync(AnalyzeIamPolicyLongrunningRequest request, CallSettings callSettings = null)

Analyzes IAM policies asynchronously to answer which identities have what accesses on which resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON format that represents a [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method implements the [google.longrunning.Operation][google.longrunning.Operation], which allows you to track the operation status. We recommend intervals of at least 2 seconds with exponential backoff retry to poll the operation result. The metadata contains the metadata for the long-running operation.

Parameters
NameDescription
requestAnalyzeIamPolicyLongrunningRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationAnalyzeIamPolicyLongrunningResponseAnalyzeIamPolicyLongrunningMetadata

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
AnalyzeIamPolicyLongrunningRequest request = new AnalyzeIamPolicyLongrunningRequest
{
    AnalysisQuery = new IamPolicyAnalysisQuery(),
    OutputConfig = new IamPolicyAnalysisOutputConfig(),
    SavedAnalysisQuery = "",
};
// Make the request
Operation<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata> response = await assetServiceClient.AnalyzeIamPolicyLongrunningAsync(request);

// Poll until the returned long-running operation is complete
Operation<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AnalyzeIamPolicyLongrunningResponse 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<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata> retrievedResponse = await assetServiceClient.PollOnceAnalyzeIamPolicyLongrunningAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AnalyzeIamPolicyLongrunningResponse retrievedResult = retrievedResponse.Result;
}

AnalyzeIamPolicyLongrunningAsync(AnalyzeIamPolicyLongrunningRequest, CancellationToken)

public virtual Task<Operation<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata>> AnalyzeIamPolicyLongrunningAsync(AnalyzeIamPolicyLongrunningRequest request, CancellationToken cancellationToken)

Analyzes IAM policies asynchronously to answer which identities have what accesses on which resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON format that represents a [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method implements the [google.longrunning.Operation][google.longrunning.Operation], which allows you to track the operation status. We recommend intervals of at least 2 seconds with exponential backoff retry to poll the operation result. The metadata contains the metadata for the long-running operation.

Parameters
NameDescription
requestAnalyzeIamPolicyLongrunningRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationAnalyzeIamPolicyLongrunningResponseAnalyzeIamPolicyLongrunningMetadata

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
AnalyzeIamPolicyLongrunningRequest request = new AnalyzeIamPolicyLongrunningRequest
{
    AnalysisQuery = new IamPolicyAnalysisQuery(),
    OutputConfig = new IamPolicyAnalysisOutputConfig(),
    SavedAnalysisQuery = "",
};
// Make the request
Operation<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata> response = await assetServiceClient.AnalyzeIamPolicyLongrunningAsync(request);

// Poll until the returned long-running operation is complete
Operation<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AnalyzeIamPolicyLongrunningResponse 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<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata> retrievedResponse = await assetServiceClient.PollOnceAnalyzeIamPolicyLongrunningAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AnalyzeIamPolicyLongrunningResponse retrievedResult = retrievedResponse.Result;
}

AnalyzeMove(AnalyzeMoveRequest, CallSettings)

public virtual AnalyzeMoveResponse AnalyzeMove(AnalyzeMoveRequest request, CallSettings callSettings = null)

Analyze moving a resource to a specified destination without kicking off the actual move. The analysis is best effort depending on the user's permissions of viewing different hierarchical policies and configurations. The policies and configuration are subject to change before the actual resource migration takes place.

Parameters
NameDescription
requestAnalyzeMoveRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AnalyzeMoveResponse

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
AnalyzeMoveRequest request = new AnalyzeMoveRequest
{
    ResourceAsProjectName = ProjectName.FromProject("[PROJECT]"),
    DestinationParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    View = AnalyzeMoveRequest.Types.AnalysisView.Unspecified,
};
// Make the request
AnalyzeMoveResponse response = assetServiceClient.AnalyzeMove(request);

AnalyzeMoveAsync(AnalyzeMoveRequest, CallSettings)

public virtual Task<AnalyzeMoveResponse> AnalyzeMoveAsync(AnalyzeMoveRequest request, CallSettings callSettings = null)

Analyze moving a resource to a specified destination without kicking off the actual move. The analysis is best effort depending on the user's permissions of viewing different hierarchical policies and configurations. The policies and configuration are subject to change before the actual resource migration takes place.

Parameters
NameDescription
requestAnalyzeMoveRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskAnalyzeMoveResponse

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
AnalyzeMoveRequest request = new AnalyzeMoveRequest
{
    ResourceAsProjectName = ProjectName.FromProject("[PROJECT]"),
    DestinationParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    View = AnalyzeMoveRequest.Types.AnalysisView.Unspecified,
};
// Make the request
AnalyzeMoveResponse response = await assetServiceClient.AnalyzeMoveAsync(request);

AnalyzeMoveAsync(AnalyzeMoveRequest, CancellationToken)

public virtual Task<AnalyzeMoveResponse> AnalyzeMoveAsync(AnalyzeMoveRequest request, CancellationToken cancellationToken)

Analyze moving a resource to a specified destination without kicking off the actual move. The analysis is best effort depending on the user's permissions of viewing different hierarchical policies and configurations. The policies and configuration are subject to change before the actual resource migration takes place.

Parameters
NameDescription
requestAnalyzeMoveRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskAnalyzeMoveResponse

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
AnalyzeMoveRequest request = new AnalyzeMoveRequest
{
    ResourceAsProjectName = ProjectName.FromProject("[PROJECT]"),
    DestinationParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    View = AnalyzeMoveRequest.Types.AnalysisView.Unspecified,
};
// Make the request
AnalyzeMoveResponse response = await assetServiceClient.AnalyzeMoveAsync(request);

AnalyzeOrgPolicies(AnalyzeOrgPoliciesRequest, CallSettings)

public virtual PagedEnumerable<AnalyzeOrgPoliciesResponse, AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult> AnalyzeOrgPolicies(AnalyzeOrgPoliciesRequest request, CallSettings callSettings = null)

Analyzes organization policies under a scope.

Parameters
NameDescription
requestAnalyzeOrgPoliciesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableAnalyzeOrgPoliciesResponseAnalyzeOrgPoliciesResponseTypesOrgPolicyResult

A pageable sequence of AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
AnalyzeOrgPoliciesRequest request = new AnalyzeOrgPoliciesRequest
{
    Scope = "",
    Constraint = "",
    Filter = "",
};
// Make the request
PagedEnumerable<AnalyzeOrgPoliciesResponse, AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult> response = assetServiceClient.AnalyzeOrgPolicies(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult 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 (AnalyzeOrgPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult 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<AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult> 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 (AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult 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;

AnalyzeOrgPolicies(string, string, string, string, int?, CallSettings)

public virtual PagedEnumerable<AnalyzeOrgPoliciesResponse, AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult> AnalyzeOrgPolicies(string scope, string constraint, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Analyzes organization policies under a scope.

Parameters
NameDescription
scopestring

Required. The organization to scope the request. Only organization policies within the scope will be analyzed.

  • organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
constraintstring

Required. The name of the constraint to analyze organization policies for. The response only contains analyzed organization policies for the provided constraint.

filterstring

The expression to filter [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results]. Filtering is currently available for bare literal values and the following fields:

  • consolidated_policy.attached_resource
  • consolidated_policy.rules.enforce

When filtering by a specific field, the only supported operator is =. For example, filtering by consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001" will return all the Organization Policy results attached to "folders/001".

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableAnalyzeOrgPoliciesResponseAnalyzeOrgPoliciesResponseTypesOrgPolicyResult

A pageable sequence of AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
string scope = "";
string constraint = "";
string filter = "";
// Make the request
PagedEnumerable<AnalyzeOrgPoliciesResponse, AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult> response = assetServiceClient.AnalyzeOrgPolicies(scope, constraint, filter);

// Iterate over all response items, lazily performing RPCs as required
foreach (AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult 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 (AnalyzeOrgPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult 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<AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult> 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 (AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult 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;

AnalyzeOrgPoliciesAsync(AnalyzeOrgPoliciesRequest, CallSettings)

public virtual PagedAsyncEnumerable<AnalyzeOrgPoliciesResponse, AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult> AnalyzeOrgPoliciesAsync(AnalyzeOrgPoliciesRequest request, CallSettings callSettings = null)

Analyzes organization policies under a scope.

Parameters
NameDescription
requestAnalyzeOrgPoliciesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableAnalyzeOrgPoliciesResponseAnalyzeOrgPoliciesResponseTypesOrgPolicyResult

A pageable asynchronous sequence of AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
AnalyzeOrgPoliciesRequest request = new AnalyzeOrgPoliciesRequest
{
    Scope = "",
    Constraint = "",
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<AnalyzeOrgPoliciesResponse, AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult> response = assetServiceClient.AnalyzeOrgPoliciesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult 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((AnalyzeOrgPoliciesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult 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<AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult> 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 (AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult 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;

AnalyzeOrgPoliciesAsync(string, string, string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<AnalyzeOrgPoliciesResponse, AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult> AnalyzeOrgPoliciesAsync(string scope, string constraint, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Analyzes organization policies under a scope.

Parameters
NameDescription
scopestring

Required. The organization to scope the request. Only organization policies within the scope will be analyzed.

  • organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
constraintstring

Required. The name of the constraint to analyze organization policies for. The response only contains analyzed organization policies for the provided constraint.

filterstring

The expression to filter [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results]. Filtering is currently available for bare literal values and the following fields:

  • consolidated_policy.attached_resource
  • consolidated_policy.rules.enforce

When filtering by a specific field, the only supported operator is =. For example, filtering by consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001" will return all the Organization Policy results attached to "folders/001".

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableAnalyzeOrgPoliciesResponseAnalyzeOrgPoliciesResponseTypesOrgPolicyResult

A pageable asynchronous sequence of AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string scope = "";
string constraint = "";
string filter = "";
// Make the request
PagedAsyncEnumerable<AnalyzeOrgPoliciesResponse, AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult> response = assetServiceClient.AnalyzeOrgPoliciesAsync(scope, constraint, filter);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult 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((AnalyzeOrgPoliciesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult 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<AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult> 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 (AnalyzeOrgPoliciesResponse.Types.OrgPolicyResult 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;

AnalyzeOrgPolicyGovernedAssets(AnalyzeOrgPolicyGovernedAssetsRequest, CallSettings)

public virtual PagedEnumerable<AnalyzeOrgPolicyGovernedAssetsResponse, AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset> AnalyzeOrgPolicyGovernedAssets(AnalyzeOrgPolicyGovernedAssetsRequest request, CallSettings callSettings = null)

Analyzes organization policies governed assets (Google Cloud resources or policies) under a scope. This RPC supports custom constraints and the following 10 canned constraints:

  • storage.uniformBucketLevelAccess
  • iam.disableServiceAccountKeyCreation
  • iam.allowedPolicyMemberDomains
  • compute.vmExternalIpAccess
  • appengine.enforceServiceAccountActAsCheck
  • gcp.resourceLocations
  • compute.trustedImageProjects
  • compute.skipDefaultNetworkCreation
  • compute.requireOsLogin
  • compute.disableNestedVirtualization

This RPC only returns either resources of types supported by search APIs or IAM policies.

Parameters
NameDescription
requestAnalyzeOrgPolicyGovernedAssetsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableAnalyzeOrgPolicyGovernedAssetsResponseAnalyzeOrgPolicyGovernedAssetsResponseTypesGovernedAsset

A pageable sequence of AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
AnalyzeOrgPolicyGovernedAssetsRequest request = new AnalyzeOrgPolicyGovernedAssetsRequest
{
    Scope = "",
    Constraint = "",
    Filter = "",
};
// Make the request
PagedEnumerable<AnalyzeOrgPolicyGovernedAssetsResponse, AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset> response = assetServiceClient.AnalyzeOrgPolicyGovernedAssets(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset 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 (AnalyzeOrgPolicyGovernedAssetsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset 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<AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset> 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 (AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset 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;

AnalyzeOrgPolicyGovernedAssets(string, string, string, string, int?, CallSettings)

public virtual PagedEnumerable<AnalyzeOrgPolicyGovernedAssetsResponse, AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset> AnalyzeOrgPolicyGovernedAssets(string scope, string constraint, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Analyzes organization policies governed assets (Google Cloud resources or policies) under a scope. This RPC supports custom constraints and the following 10 canned constraints:

  • storage.uniformBucketLevelAccess
  • iam.disableServiceAccountKeyCreation
  • iam.allowedPolicyMemberDomains
  • compute.vmExternalIpAccess
  • appengine.enforceServiceAccountActAsCheck
  • gcp.resourceLocations
  • compute.trustedImageProjects
  • compute.skipDefaultNetworkCreation
  • compute.requireOsLogin
  • compute.disableNestedVirtualization

This RPC only returns either resources of types supported by search APIs or IAM policies.

Parameters
NameDescription
scopestring

Required. The organization to scope the request. Only organization policies within the scope will be analyzed. The output assets will also be limited to the ones governed by those in-scope organization policies.

  • organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
constraintstring

Required. The name of the constraint to analyze governed assets for. The analysis only contains analyzed organization policies for the provided constraint.

filterstring

The expression to filter [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets].

For governed resources, filtering is currently available for bare literal values and the following fields:

  • governed_resource.project
  • governed_resource.folders
  • consolidated_policy.rules.enforce When filtering by governed_resource.project or consolidated_policy.rules.enforce, the only supported operator is =. When filtering by governed_resource.folders, the supported operators are = and :. For example, filtering by governed_resource.project="projects/12345678" will return all the governed resources under "projects/12345678", including the project itself if applicable.

For governed IAM policies, filtering is currently available for bare literal values and the following fields:

  • governed_iam_policy.project
  • governed_iam_policy.folders
  • consolidated_policy.rules.enforce When filtering by governed_iam_policy.project or consolidated_policy.rules.enforce, the only supported operator is =. When filtering by governed_iam_policy.folders, the supported operators are = and :. For example, filtering by governed_iam_policy.folders:"folders/12345678" will return all the governed IAM policies under "folders/001".
pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableAnalyzeOrgPolicyGovernedAssetsResponseAnalyzeOrgPolicyGovernedAssetsResponseTypesGovernedAsset

A pageable sequence of AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
string scope = "";
string constraint = "";
string filter = "";
// Make the request
PagedEnumerable<AnalyzeOrgPolicyGovernedAssetsResponse, AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset> response = assetServiceClient.AnalyzeOrgPolicyGovernedAssets(scope, constraint, filter);

// Iterate over all response items, lazily performing RPCs as required
foreach (AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset 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 (AnalyzeOrgPolicyGovernedAssetsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset 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<AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset> 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 (AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset 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;

AnalyzeOrgPolicyGovernedAssetsAsync(AnalyzeOrgPolicyGovernedAssetsRequest, CallSettings)

public virtual PagedAsyncEnumerable<AnalyzeOrgPolicyGovernedAssetsResponse, AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset> AnalyzeOrgPolicyGovernedAssetsAsync(AnalyzeOrgPolicyGovernedAssetsRequest request, CallSettings callSettings = null)

Analyzes organization policies governed assets (Google Cloud resources or policies) under a scope. This RPC supports custom constraints and the following 10 canned constraints:

  • storage.uniformBucketLevelAccess
  • iam.disableServiceAccountKeyCreation
  • iam.allowedPolicyMemberDomains
  • compute.vmExternalIpAccess
  • appengine.enforceServiceAccountActAsCheck
  • gcp.resourceLocations
  • compute.trustedImageProjects
  • compute.skipDefaultNetworkCreation
  • compute.requireOsLogin
  • compute.disableNestedVirtualization

This RPC only returns either resources of types supported by search APIs or IAM policies.

Parameters
NameDescription
requestAnalyzeOrgPolicyGovernedAssetsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableAnalyzeOrgPolicyGovernedAssetsResponseAnalyzeOrgPolicyGovernedAssetsResponseTypesGovernedAsset

A pageable asynchronous sequence of AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
AnalyzeOrgPolicyGovernedAssetsRequest request = new AnalyzeOrgPolicyGovernedAssetsRequest
{
    Scope = "",
    Constraint = "",
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<AnalyzeOrgPolicyGovernedAssetsResponse, AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset> response = assetServiceClient.AnalyzeOrgPolicyGovernedAssetsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset 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((AnalyzeOrgPolicyGovernedAssetsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset 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<AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset> 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 (AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset 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;

AnalyzeOrgPolicyGovernedAssetsAsync(string, string, string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<AnalyzeOrgPolicyGovernedAssetsResponse, AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset> AnalyzeOrgPolicyGovernedAssetsAsync(string scope, string constraint, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Analyzes organization policies governed assets (Google Cloud resources or policies) under a scope. This RPC supports custom constraints and the following 10 canned constraints:

  • storage.uniformBucketLevelAccess
  • iam.disableServiceAccountKeyCreation
  • iam.allowedPolicyMemberDomains
  • compute.vmExternalIpAccess
  • appengine.enforceServiceAccountActAsCheck
  • gcp.resourceLocations
  • compute.trustedImageProjects
  • compute.skipDefaultNetworkCreation
  • compute.requireOsLogin
  • compute.disableNestedVirtualization

This RPC only returns either resources of types supported by search APIs or IAM policies.

Parameters
NameDescription
scopestring

Required. The organization to scope the request. Only organization policies within the scope will be analyzed. The output assets will also be limited to the ones governed by those in-scope organization policies.

  • organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
constraintstring

Required. The name of the constraint to analyze governed assets for. The analysis only contains analyzed organization policies for the provided constraint.

filterstring

The expression to filter [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets].

For governed resources, filtering is currently available for bare literal values and the following fields:

  • governed_resource.project
  • governed_resource.folders
  • consolidated_policy.rules.enforce When filtering by governed_resource.project or consolidated_policy.rules.enforce, the only supported operator is =. When filtering by governed_resource.folders, the supported operators are = and :. For example, filtering by governed_resource.project="projects/12345678" will return all the governed resources under "projects/12345678", including the project itself if applicable.

For governed IAM policies, filtering is currently available for bare literal values and the following fields:

  • governed_iam_policy.project
  • governed_iam_policy.folders
  • consolidated_policy.rules.enforce When filtering by governed_iam_policy.project or consolidated_policy.rules.enforce, the only supported operator is =. When filtering by governed_iam_policy.folders, the supported operators are = and :. For example, filtering by governed_iam_policy.folders:"folders/12345678" will return all the governed IAM policies under "folders/001".
pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableAnalyzeOrgPolicyGovernedAssetsResponseAnalyzeOrgPolicyGovernedAssetsResponseTypesGovernedAsset

A pageable asynchronous sequence of AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string scope = "";
string constraint = "";
string filter = "";
// Make the request
PagedAsyncEnumerable<AnalyzeOrgPolicyGovernedAssetsResponse, AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset> response = assetServiceClient.AnalyzeOrgPolicyGovernedAssetsAsync(scope, constraint, filter);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset 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((AnalyzeOrgPolicyGovernedAssetsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset 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<AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset> 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 (AnalyzeOrgPolicyGovernedAssetsResponse.Types.GovernedAsset 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;

AnalyzeOrgPolicyGovernedContainers(AnalyzeOrgPolicyGovernedContainersRequest, CallSettings)

public virtual PagedEnumerable<AnalyzeOrgPolicyGovernedContainersResponse, AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer> AnalyzeOrgPolicyGovernedContainers(AnalyzeOrgPolicyGovernedContainersRequest request, CallSettings callSettings = null)

Analyzes organization policies governed containers (projects, folders or organization) under a scope.

Parameters
NameDescription
requestAnalyzeOrgPolicyGovernedContainersRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableAnalyzeOrgPolicyGovernedContainersResponseAnalyzeOrgPolicyGovernedContainersResponseTypesGovernedContainer

A pageable sequence of AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
AnalyzeOrgPolicyGovernedContainersRequest request = new AnalyzeOrgPolicyGovernedContainersRequest
{
    Scope = "",
    Constraint = "",
    Filter = "",
};
// Make the request
PagedEnumerable<AnalyzeOrgPolicyGovernedContainersResponse, AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer> response = assetServiceClient.AnalyzeOrgPolicyGovernedContainers(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer 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 (AnalyzeOrgPolicyGovernedContainersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer 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<AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer> 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 (AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer 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;

AnalyzeOrgPolicyGovernedContainers(string, string, string, string, int?, CallSettings)

public virtual PagedEnumerable<AnalyzeOrgPolicyGovernedContainersResponse, AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer> AnalyzeOrgPolicyGovernedContainers(string scope, string constraint, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Analyzes organization policies governed containers (projects, folders or organization) under a scope.

Parameters
NameDescription
scopestring

Required. The organization to scope the request. Only organization policies within the scope will be analyzed. The output containers will also be limited to the ones governed by those in-scope organization policies.

  • organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
constraintstring

Required. The name of the constraint to analyze governed containers for. The analysis only contains organization policies for the provided constraint.

filterstring

The expression to filter [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers]. Filtering is currently available for bare literal values and the following fields:

  • parent
  • consolidated_policy.rules.enforce

When filtering by a specific field, the only supported operator is =. For example, filtering by parent="//cloudresourcemanager.googleapis.com/folders/001" will return all the containers under "folders/001".

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableAnalyzeOrgPolicyGovernedContainersResponseAnalyzeOrgPolicyGovernedContainersResponseTypesGovernedContainer

A pageable sequence of AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
string scope = "";
string constraint = "";
string filter = "";
// Make the request
PagedEnumerable<AnalyzeOrgPolicyGovernedContainersResponse, AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer> response = assetServiceClient.AnalyzeOrgPolicyGovernedContainers(scope, constraint, filter);

// Iterate over all response items, lazily performing RPCs as required
foreach (AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer 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 (AnalyzeOrgPolicyGovernedContainersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer 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<AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer> 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 (AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer 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;

AnalyzeOrgPolicyGovernedContainersAsync(AnalyzeOrgPolicyGovernedContainersRequest, CallSettings)

public virtual PagedAsyncEnumerable<AnalyzeOrgPolicyGovernedContainersResponse, AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer> AnalyzeOrgPolicyGovernedContainersAsync(AnalyzeOrgPolicyGovernedContainersRequest request, CallSettings callSettings = null)

Analyzes organization policies governed containers (projects, folders or organization) under a scope.

Parameters
NameDescription
requestAnalyzeOrgPolicyGovernedContainersRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableAnalyzeOrgPolicyGovernedContainersResponseAnalyzeOrgPolicyGovernedContainersResponseTypesGovernedContainer

A pageable asynchronous sequence of AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
AnalyzeOrgPolicyGovernedContainersRequest request = new AnalyzeOrgPolicyGovernedContainersRequest
{
    Scope = "",
    Constraint = "",
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<AnalyzeOrgPolicyGovernedContainersResponse, AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer> response = assetServiceClient.AnalyzeOrgPolicyGovernedContainersAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer 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((AnalyzeOrgPolicyGovernedContainersResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer 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<AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer> 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 (AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer 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;

AnalyzeOrgPolicyGovernedContainersAsync(string, string, string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<AnalyzeOrgPolicyGovernedContainersResponse, AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer> AnalyzeOrgPolicyGovernedContainersAsync(string scope, string constraint, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Analyzes organization policies governed containers (projects, folders or organization) under a scope.

Parameters
NameDescription
scopestring

Required. The organization to scope the request. Only organization policies within the scope will be analyzed. The output containers will also be limited to the ones governed by those in-scope organization policies.

  • organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
constraintstring

Required. The name of the constraint to analyze governed containers for. The analysis only contains organization policies for the provided constraint.

filterstring

The expression to filter [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers]. Filtering is currently available for bare literal values and the following fields:

  • parent
  • consolidated_policy.rules.enforce

When filtering by a specific field, the only supported operator is =. For example, filtering by parent="//cloudresourcemanager.googleapis.com/folders/001" will return all the containers under "folders/001".

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableAnalyzeOrgPolicyGovernedContainersResponseAnalyzeOrgPolicyGovernedContainersResponseTypesGovernedContainer

A pageable asynchronous sequence of AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string scope = "";
string constraint = "";
string filter = "";
// Make the request
PagedAsyncEnumerable<AnalyzeOrgPolicyGovernedContainersResponse, AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer> response = assetServiceClient.AnalyzeOrgPolicyGovernedContainersAsync(scope, constraint, filter);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer 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((AnalyzeOrgPolicyGovernedContainersResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer 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<AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer> 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 (AnalyzeOrgPolicyGovernedContainersResponse.Types.GovernedContainer 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;

BatchGetAssetsHistory(BatchGetAssetsHistoryRequest, CallSettings)

public virtual BatchGetAssetsHistoryResponse BatchGetAssetsHistory(BatchGetAssetsHistoryRequest request, CallSettings callSettings = null)

Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error.

Parameters
NameDescription
requestBatchGetAssetsHistoryRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BatchGetAssetsHistoryResponse

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
BatchGetAssetsHistoryRequest request = new BatchGetAssetsHistoryRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    AssetNames = { "", },
    ContentType = ContentType.Unspecified,
    ReadTimeWindow = new TimeWindow(),
    RelationshipTypes = { "", },
};
// Make the request
BatchGetAssetsHistoryResponse response = assetServiceClient.BatchGetAssetsHistory(request);

BatchGetAssetsHistoryAsync(BatchGetAssetsHistoryRequest, CallSettings)

public virtual Task<BatchGetAssetsHistoryResponse> BatchGetAssetsHistoryAsync(BatchGetAssetsHistoryRequest request, CallSettings callSettings = null)

Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error.

Parameters
NameDescription
requestBatchGetAssetsHistoryRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskBatchGetAssetsHistoryResponse

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
BatchGetAssetsHistoryRequest request = new BatchGetAssetsHistoryRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    AssetNames = { "", },
    ContentType = ContentType.Unspecified,
    ReadTimeWindow = new TimeWindow(),
    RelationshipTypes = { "", },
};
// Make the request
BatchGetAssetsHistoryResponse response = await assetServiceClient.BatchGetAssetsHistoryAsync(request);

BatchGetAssetsHistoryAsync(BatchGetAssetsHistoryRequest, CancellationToken)

public virtual Task<BatchGetAssetsHistoryResponse> BatchGetAssetsHistoryAsync(BatchGetAssetsHistoryRequest request, CancellationToken cancellationToken)

Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error.

Parameters
NameDescription
requestBatchGetAssetsHistoryRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskBatchGetAssetsHistoryResponse

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
BatchGetAssetsHistoryRequest request = new BatchGetAssetsHistoryRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    AssetNames = { "", },
    ContentType = ContentType.Unspecified,
    ReadTimeWindow = new TimeWindow(),
    RelationshipTypes = { "", },
};
// Make the request
BatchGetAssetsHistoryResponse response = await assetServiceClient.BatchGetAssetsHistoryAsync(request);

BatchGetEffectiveIamPolicies(BatchGetEffectiveIamPoliciesRequest, CallSettings)

public virtual BatchGetEffectiveIamPoliciesResponse BatchGetEffectiveIamPolicies(BatchGetEffectiveIamPoliciesRequest request, CallSettings callSettings = null)

Gets effective IAM policies for a batch of resources.

Parameters
NameDescription
requestBatchGetEffectiveIamPoliciesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BatchGetEffectiveIamPoliciesResponse

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
BatchGetEffectiveIamPoliciesRequest request = new BatchGetEffectiveIamPoliciesRequest
{
    ScopeAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    ResourceNames =
    {
        new UnparsedResourceName("a/wildcard/resource"),
    },
};
// Make the request
BatchGetEffectiveIamPoliciesResponse response = assetServiceClient.BatchGetEffectiveIamPolicies(request);

BatchGetEffectiveIamPoliciesAsync(BatchGetEffectiveIamPoliciesRequest, CallSettings)

public virtual Task<BatchGetEffectiveIamPoliciesResponse> BatchGetEffectiveIamPoliciesAsync(BatchGetEffectiveIamPoliciesRequest request, CallSettings callSettings = null)

Gets effective IAM policies for a batch of resources.

Parameters
NameDescription
requestBatchGetEffectiveIamPoliciesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskBatchGetEffectiveIamPoliciesResponse

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
BatchGetEffectiveIamPoliciesRequest request = new BatchGetEffectiveIamPoliciesRequest
{
    ScopeAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    ResourceNames =
    {
        new UnparsedResourceName("a/wildcard/resource"),
    },
};
// Make the request
BatchGetEffectiveIamPoliciesResponse response = await assetServiceClient.BatchGetEffectiveIamPoliciesAsync(request);

BatchGetEffectiveIamPoliciesAsync(BatchGetEffectiveIamPoliciesRequest, CancellationToken)

public virtual Task<BatchGetEffectiveIamPoliciesResponse> BatchGetEffectiveIamPoliciesAsync(BatchGetEffectiveIamPoliciesRequest request, CancellationToken cancellationToken)

Gets effective IAM policies for a batch of resources.

Parameters
NameDescription
requestBatchGetEffectiveIamPoliciesRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskBatchGetEffectiveIamPoliciesResponse

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
BatchGetEffectiveIamPoliciesRequest request = new BatchGetEffectiveIamPoliciesRequest
{
    ScopeAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    ResourceNames =
    {
        new UnparsedResourceName("a/wildcard/resource"),
    },
};
// Make the request
BatchGetEffectiveIamPoliciesResponse response = await assetServiceClient.BatchGetEffectiveIamPoliciesAsync(request);

Create()

public static AssetServiceClient Create()

Synchronously creates a AssetServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AssetServiceClientBuilder.

Returns
TypeDescription
AssetServiceClient

The created AssetServiceClient.

CreateAsync(CancellationToken)

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

Asynchronously creates a AssetServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AssetServiceClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskAssetServiceClient

The task representing the created AssetServiceClient.

CreateFeed(CreateFeedRequest, CallSettings)

public virtual Feed CreateFeed(CreateFeedRequest request, CallSettings callSettings = null)

Creates a feed in a parent project/folder/organization to listen to its asset updates.

Parameters
NameDescription
requestCreateFeedRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Feed

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
CreateFeedRequest request = new CreateFeedRequest
{
    Parent = "",
    FeedId = "",
    Feed = new Feed(),
};
// Make the request
Feed response = assetServiceClient.CreateFeed(request);

CreateFeed(string, CallSettings)

public virtual Feed CreateFeed(string parent, CallSettings callSettings = null)

Creates a feed in a parent project/folder/organization to listen to its asset updates.

Parameters
NameDescription
parentstring

Required. The name of the project/folder/organization where this feed should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Feed

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
string parent = "";
// Make the request
Feed response = assetServiceClient.CreateFeed(parent);

CreateFeedAsync(CreateFeedRequest, CallSettings)

public virtual Task<Feed> CreateFeedAsync(CreateFeedRequest request, CallSettings callSettings = null)

Creates a feed in a parent project/folder/organization to listen to its asset updates.

Parameters
NameDescription
requestCreateFeedRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskFeed

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
CreateFeedRequest request = new CreateFeedRequest
{
    Parent = "",
    FeedId = "",
    Feed = new Feed(),
};
// Make the request
Feed response = await assetServiceClient.CreateFeedAsync(request);

CreateFeedAsync(CreateFeedRequest, CancellationToken)

public virtual Task<Feed> CreateFeedAsync(CreateFeedRequest request, CancellationToken cancellationToken)

Creates a feed in a parent project/folder/organization to listen to its asset updates.

Parameters
NameDescription
requestCreateFeedRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskFeed

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
CreateFeedRequest request = new CreateFeedRequest
{
    Parent = "",
    FeedId = "",
    Feed = new Feed(),
};
// Make the request
Feed response = await assetServiceClient.CreateFeedAsync(request);

CreateFeedAsync(string, CallSettings)

public virtual Task<Feed> CreateFeedAsync(string parent, CallSettings callSettings = null)

Creates a feed in a parent project/folder/organization to listen to its asset updates.

Parameters
NameDescription
parentstring

Required. The name of the project/folder/organization where this feed should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskFeed

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "";
// Make the request
Feed response = await assetServiceClient.CreateFeedAsync(parent);

CreateFeedAsync(string, CancellationToken)

public virtual Task<Feed> CreateFeedAsync(string parent, CancellationToken cancellationToken)

Creates a feed in a parent project/folder/organization to listen to its asset updates.

Parameters
NameDescription
parentstring

Required. The name of the project/folder/organization where this feed should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskFeed

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "";
// Make the request
Feed response = await assetServiceClient.CreateFeedAsync(parent);

CreateSavedQuery(FolderName, SavedQuery, string, CallSettings)

public virtual SavedQuery CreateSavedQuery(FolderName parent, SavedQuery savedQuery, string savedQueryId, CallSettings callSettings = null)

Creates a saved query in a parent project/folder/organization.

Parameters
NameDescription
parentFolderName

Required. The name of the project/folder/organization where this saved_query should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

savedQuerySavedQuery

Required. The saved_query details. The name field must be empty as it will be generated based on the parent and saved_query_id.

savedQueryIdstring

Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name.

This value should be 4-63 characters, and valid characters are [a-z][0-9]-.

Notice that this field is required in the saved query creation, and the name field of the saved_query will be ignored.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SavedQuery

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
FolderName parent = FolderName.FromFolder("[FOLDER]");
SavedQuery savedQuery = new SavedQuery();
string savedQueryId = "";
// Make the request
SavedQuery response = assetServiceClient.CreateSavedQuery(parent, savedQuery, savedQueryId);

CreateSavedQuery(OrganizationName, SavedQuery, string, CallSettings)

public virtual SavedQuery CreateSavedQuery(OrganizationName parent, SavedQuery savedQuery, string savedQueryId, CallSettings callSettings = null)

Creates a saved query in a parent project/folder/organization.

Parameters
NameDescription
parentOrganizationName

Required. The name of the project/folder/organization where this saved_query should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

savedQuerySavedQuery

Required. The saved_query details. The name field must be empty as it will be generated based on the parent and saved_query_id.

savedQueryIdstring

Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name.

This value should be 4-63 characters, and valid characters are [a-z][0-9]-.

Notice that this field is required in the saved query creation, and the name field of the saved_query will be ignored.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SavedQuery

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
OrganizationName parent = OrganizationName.FromOrganization("[ORGANIZATION]");
SavedQuery savedQuery = new SavedQuery();
string savedQueryId = "";
// Make the request
SavedQuery response = assetServiceClient.CreateSavedQuery(parent, savedQuery, savedQueryId);

CreateSavedQuery(ProjectName, SavedQuery, string, CallSettings)

public virtual SavedQuery CreateSavedQuery(ProjectName parent, SavedQuery savedQuery, string savedQueryId, CallSettings callSettings = null)

Creates a saved query in a parent project/folder/organization.

Parameters
NameDescription
parentProjectName

Required. The name of the project/folder/organization where this saved_query should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

savedQuerySavedQuery

Required. The saved_query details. The name field must be empty as it will be generated based on the parent and saved_query_id.

savedQueryIdstring

Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name.

This value should be 4-63 characters, and valid characters are [a-z][0-9]-.

Notice that this field is required in the saved query creation, and the name field of the saved_query will be ignored.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SavedQuery

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
SavedQuery savedQuery = new SavedQuery();
string savedQueryId = "";
// Make the request
SavedQuery response = assetServiceClient.CreateSavedQuery(parent, savedQuery, savedQueryId);

CreateSavedQuery(CreateSavedQueryRequest, CallSettings)

public virtual SavedQuery CreateSavedQuery(CreateSavedQueryRequest request, CallSettings callSettings = null)

Creates a saved query in a parent project/folder/organization.

Parameters
NameDescription
requestCreateSavedQueryRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SavedQuery

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
CreateSavedQueryRequest request = new CreateSavedQueryRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    SavedQuery = new SavedQuery(),
    SavedQueryId = "",
};
// Make the request
SavedQuery response = assetServiceClient.CreateSavedQuery(request);

CreateSavedQuery(string, SavedQuery, string, CallSettings)

public virtual SavedQuery CreateSavedQuery(string parent, SavedQuery savedQuery, string savedQueryId, CallSettings callSettings = null)

Creates a saved query in a parent project/folder/organization.

Parameters
NameDescription
parentstring

Required. The name of the project/folder/organization where this saved_query should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

savedQuerySavedQuery

Required. The saved_query details. The name field must be empty as it will be generated based on the parent and saved_query_id.

savedQueryIdstring

Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name.

This value should be 4-63 characters, and valid characters are [a-z][0-9]-.

Notice that this field is required in the saved query creation, and the name field of the saved_query will be ignored.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SavedQuery

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
SavedQuery savedQuery = new SavedQuery();
string savedQueryId = "";
// Make the request
SavedQuery response = assetServiceClient.CreateSavedQuery(parent, savedQuery, savedQueryId);

CreateSavedQueryAsync(FolderName, SavedQuery, string, CallSettings)

public virtual Task<SavedQuery> CreateSavedQueryAsync(FolderName parent, SavedQuery savedQuery, string savedQueryId, CallSettings callSettings = null)

Creates a saved query in a parent project/folder/organization.

Parameters
NameDescription
parentFolderName

Required. The name of the project/folder/organization where this saved_query should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

savedQuerySavedQuery

Required. The saved_query details. The name field must be empty as it will be generated based on the parent and saved_query_id.

savedQueryIdstring

Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name.

This value should be 4-63 characters, and valid characters are [a-z][0-9]-.

Notice that this field is required in the saved query creation, and the name field of the saved_query will be ignored.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
FolderName parent = FolderName.FromFolder("[FOLDER]");
SavedQuery savedQuery = new SavedQuery();
string savedQueryId = "";
// Make the request
SavedQuery response = await assetServiceClient.CreateSavedQueryAsync(parent, savedQuery, savedQueryId);

CreateSavedQueryAsync(FolderName, SavedQuery, string, CancellationToken)

public virtual Task<SavedQuery> CreateSavedQueryAsync(FolderName parent, SavedQuery savedQuery, string savedQueryId, CancellationToken cancellationToken)

Creates a saved query in a parent project/folder/organization.

Parameters
NameDescription
parentFolderName

Required. The name of the project/folder/organization where this saved_query should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

savedQuerySavedQuery

Required. The saved_query details. The name field must be empty as it will be generated based on the parent and saved_query_id.

savedQueryIdstring

Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name.

This value should be 4-63 characters, and valid characters are [a-z][0-9]-.

Notice that this field is required in the saved query creation, and the name field of the saved_query will be ignored.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
FolderName parent = FolderName.FromFolder("[FOLDER]");
SavedQuery savedQuery = new SavedQuery();
string savedQueryId = "";
// Make the request
SavedQuery response = await assetServiceClient.CreateSavedQueryAsync(parent, savedQuery, savedQueryId);

CreateSavedQueryAsync(OrganizationName, SavedQuery, string, CallSettings)

public virtual Task<SavedQuery> CreateSavedQueryAsync(OrganizationName parent, SavedQuery savedQuery, string savedQueryId, CallSettings callSettings = null)

Creates a saved query in a parent project/folder/organization.

Parameters
NameDescription
parentOrganizationName

Required. The name of the project/folder/organization where this saved_query should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

savedQuerySavedQuery

Required. The saved_query details. The name field must be empty as it will be generated based on the parent and saved_query_id.

savedQueryIdstring

Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name.

This value should be 4-63 characters, and valid characters are [a-z][0-9]-.

Notice that this field is required in the saved query creation, and the name field of the saved_query will be ignored.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
OrganizationName parent = OrganizationName.FromOrganization("[ORGANIZATION]");
SavedQuery savedQuery = new SavedQuery();
string savedQueryId = "";
// Make the request
SavedQuery response = await assetServiceClient.CreateSavedQueryAsync(parent, savedQuery, savedQueryId);

CreateSavedQueryAsync(OrganizationName, SavedQuery, string, CancellationToken)

public virtual Task<SavedQuery> CreateSavedQueryAsync(OrganizationName parent, SavedQuery savedQuery, string savedQueryId, CancellationToken cancellationToken)

Creates a saved query in a parent project/folder/organization.

Parameters
NameDescription
parentOrganizationName

Required. The name of the project/folder/organization where this saved_query should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

savedQuerySavedQuery

Required. The saved_query details. The name field must be empty as it will be generated based on the parent and saved_query_id.

savedQueryIdstring

Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name.

This value should be 4-63 characters, and valid characters are [a-z][0-9]-.

Notice that this field is required in the saved query creation, and the name field of the saved_query will be ignored.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
OrganizationName parent = OrganizationName.FromOrganization("[ORGANIZATION]");
SavedQuery savedQuery = new SavedQuery();
string savedQueryId = "";
// Make the request
SavedQuery response = await assetServiceClient.CreateSavedQueryAsync(parent, savedQuery, savedQueryId);

CreateSavedQueryAsync(ProjectName, SavedQuery, string, CallSettings)

public virtual Task<SavedQuery> CreateSavedQueryAsync(ProjectName parent, SavedQuery savedQuery, string savedQueryId, CallSettings callSettings = null)

Creates a saved query in a parent project/folder/organization.

Parameters
NameDescription
parentProjectName

Required. The name of the project/folder/organization where this saved_query should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

savedQuerySavedQuery

Required. The saved_query details. The name field must be empty as it will be generated based on the parent and saved_query_id.

savedQueryIdstring

Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name.

This value should be 4-63 characters, and valid characters are [a-z][0-9]-.

Notice that this field is required in the saved query creation, and the name field of the saved_query will be ignored.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
SavedQuery savedQuery = new SavedQuery();
string savedQueryId = "";
// Make the request
SavedQuery response = await assetServiceClient.CreateSavedQueryAsync(parent, savedQuery, savedQueryId);

CreateSavedQueryAsync(ProjectName, SavedQuery, string, CancellationToken)

public virtual Task<SavedQuery> CreateSavedQueryAsync(ProjectName parent, SavedQuery savedQuery, string savedQueryId, CancellationToken cancellationToken)

Creates a saved query in a parent project/folder/organization.

Parameters
NameDescription
parentProjectName

Required. The name of the project/folder/organization where this saved_query should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

savedQuerySavedQuery

Required. The saved_query details. The name field must be empty as it will be generated based on the parent and saved_query_id.

savedQueryIdstring

Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name.

This value should be 4-63 characters, and valid characters are [a-z][0-9]-.

Notice that this field is required in the saved query creation, and the name field of the saved_query will be ignored.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
SavedQuery savedQuery = new SavedQuery();
string savedQueryId = "";
// Make the request
SavedQuery response = await assetServiceClient.CreateSavedQueryAsync(parent, savedQuery, savedQueryId);

CreateSavedQueryAsync(CreateSavedQueryRequest, CallSettings)

public virtual Task<SavedQuery> CreateSavedQueryAsync(CreateSavedQueryRequest request, CallSettings callSettings = null)

Creates a saved query in a parent project/folder/organization.

Parameters
NameDescription
requestCreateSavedQueryRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSavedQueryRequest request = new CreateSavedQueryRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    SavedQuery = new SavedQuery(),
    SavedQueryId = "",
};
// Make the request
SavedQuery response = await assetServiceClient.CreateSavedQueryAsync(request);

CreateSavedQueryAsync(CreateSavedQueryRequest, CancellationToken)

public virtual Task<SavedQuery> CreateSavedQueryAsync(CreateSavedQueryRequest request, CancellationToken cancellationToken)

Creates a saved query in a parent project/folder/organization.

Parameters
NameDescription
requestCreateSavedQueryRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSavedQueryRequest request = new CreateSavedQueryRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    SavedQuery = new SavedQuery(),
    SavedQueryId = "",
};
// Make the request
SavedQuery response = await assetServiceClient.CreateSavedQueryAsync(request);

CreateSavedQueryAsync(string, SavedQuery, string, CallSettings)

public virtual Task<SavedQuery> CreateSavedQueryAsync(string parent, SavedQuery savedQuery, string savedQueryId, CallSettings callSettings = null)

Creates a saved query in a parent project/folder/organization.

Parameters
NameDescription
parentstring

Required. The name of the project/folder/organization where this saved_query should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

savedQuerySavedQuery

Required. The saved_query details. The name field must be empty as it will be generated based on the parent and saved_query_id.

savedQueryIdstring

Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name.

This value should be 4-63 characters, and valid characters are [a-z][0-9]-.

Notice that this field is required in the saved query creation, and the name field of the saved_query will be ignored.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
SavedQuery savedQuery = new SavedQuery();
string savedQueryId = "";
// Make the request
SavedQuery response = await assetServiceClient.CreateSavedQueryAsync(parent, savedQuery, savedQueryId);

CreateSavedQueryAsync(string, SavedQuery, string, CancellationToken)

public virtual Task<SavedQuery> CreateSavedQueryAsync(string parent, SavedQuery savedQuery, string savedQueryId, CancellationToken cancellationToken)

Creates a saved query in a parent project/folder/organization.

Parameters
NameDescription
parentstring

Required. The name of the project/folder/organization where this saved_query should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

savedQuerySavedQuery

Required. The saved_query details. The name field must be empty as it will be generated based on the parent and saved_query_id.

savedQueryIdstring

Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name.

This value should be 4-63 characters, and valid characters are [a-z][0-9]-.

Notice that this field is required in the saved query creation, and the name field of the saved_query will be ignored.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
SavedQuery savedQuery = new SavedQuery();
string savedQueryId = "";
// Make the request
SavedQuery response = await assetServiceClient.CreateSavedQueryAsync(parent, savedQuery, savedQueryId);

DeleteFeed(DeleteFeedRequest, CallSettings)

public virtual void DeleteFeed(DeleteFeedRequest request, CallSettings callSettings = null)

Deletes an asset feed.

Parameters
NameDescription
requestDeleteFeedRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
DeleteFeedRequest request = new DeleteFeedRequest
{
    FeedName = FeedName.FromProjectFeed("[PROJECT]", "[FEED]"),
};
// Make the request
assetServiceClient.DeleteFeed(request);

DeleteFeed(FeedName, CallSettings)

public virtual void DeleteFeed(FeedName name, CallSettings callSettings = null)

Deletes an asset feed.

Parameters
NameDescription
nameFeedName

Required. The name of the feed and it must be in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
FeedName name = FeedName.FromProjectFeed("[PROJECT]", "[FEED]");
// Make the request
assetServiceClient.DeleteFeed(name);

DeleteFeed(string, CallSettings)

public virtual void DeleteFeed(string name, CallSettings callSettings = null)

Deletes an asset feed.

Parameters
NameDescription
namestring

Required. The name of the feed and it must be in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/feeds/[FEED]";
// Make the request
assetServiceClient.DeleteFeed(name);

DeleteFeedAsync(DeleteFeedRequest, CallSettings)

public virtual Task DeleteFeedAsync(DeleteFeedRequest request, CallSettings callSettings = null)

Deletes an asset feed.

Parameters
NameDescription
requestDeleteFeedRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteFeedRequest request = new DeleteFeedRequest
{
    FeedName = FeedName.FromProjectFeed("[PROJECT]", "[FEED]"),
};
// Make the request
await assetServiceClient.DeleteFeedAsync(request);

DeleteFeedAsync(DeleteFeedRequest, CancellationToken)

public virtual Task DeleteFeedAsync(DeleteFeedRequest request, CancellationToken cancellationToken)

Deletes an asset feed.

Parameters
NameDescription
requestDeleteFeedRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteFeedRequest request = new DeleteFeedRequest
{
    FeedName = FeedName.FromProjectFeed("[PROJECT]", "[FEED]"),
};
// Make the request
await assetServiceClient.DeleteFeedAsync(request);

DeleteFeedAsync(FeedName, CallSettings)

public virtual Task DeleteFeedAsync(FeedName name, CallSettings callSettings = null)

Deletes an asset feed.

Parameters
NameDescription
nameFeedName

Required. The name of the feed and it must be in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
FeedName name = FeedName.FromProjectFeed("[PROJECT]", "[FEED]");
// Make the request
await assetServiceClient.DeleteFeedAsync(name);

DeleteFeedAsync(FeedName, CancellationToken)

public virtual Task DeleteFeedAsync(FeedName name, CancellationToken cancellationToken)

Deletes an asset feed.

Parameters
NameDescription
nameFeedName

Required. The name of the feed and it must be in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
FeedName name = FeedName.FromProjectFeed("[PROJECT]", "[FEED]");
// Make the request
await assetServiceClient.DeleteFeedAsync(name);

DeleteFeedAsync(string, CallSettings)

public virtual Task DeleteFeedAsync(string name, CallSettings callSettings = null)

Deletes an asset feed.

Parameters
NameDescription
namestring

Required. The name of the feed and it must be in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/feeds/[FEED]";
// Make the request
await assetServiceClient.DeleteFeedAsync(name);

DeleteFeedAsync(string, CancellationToken)

public virtual Task DeleteFeedAsync(string name, CancellationToken cancellationToken)

Deletes an asset feed.

Parameters
NameDescription
namestring

Required. The name of the feed and it must be in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/feeds/[FEED]";
// Make the request
await assetServiceClient.DeleteFeedAsync(name);

DeleteSavedQuery(DeleteSavedQueryRequest, CallSettings)

public virtual void DeleteSavedQuery(DeleteSavedQueryRequest request, CallSettings callSettings = null)

Deletes a saved query.

Parameters
NameDescription
requestDeleteSavedQueryRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
DeleteSavedQueryRequest request = new DeleteSavedQueryRequest
{
    SavedQueryName = SavedQueryName.FromProjectSavedQuery("[PROJECT]", "[SAVED_QUERY]"),
};
// Make the request
assetServiceClient.DeleteSavedQuery(request);

DeleteSavedQuery(SavedQueryName, CallSettings)

public virtual void DeleteSavedQuery(SavedQueryName name, CallSettings callSettings = null)

Deletes a saved query.

Parameters
NameDescription
nameSavedQueryName

Required. The name of the saved query to delete. It must be in the format of:

  • projects/project_number/savedQueries/saved_query_id
  • folders/folder_number/savedQueries/saved_query_id
  • organizations/organization_number/savedQueries/saved_query_id
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
SavedQueryName name = SavedQueryName.FromProjectSavedQuery("[PROJECT]", "[SAVED_QUERY]");
// Make the request
assetServiceClient.DeleteSavedQuery(name);

DeleteSavedQuery(string, CallSettings)

public virtual void DeleteSavedQuery(string name, CallSettings callSettings = null)

Deletes a saved query.

Parameters
NameDescription
namestring

Required. The name of the saved query to delete. It must be in the format of:

  • projects/project_number/savedQueries/saved_query_id
  • folders/folder_number/savedQueries/saved_query_id
  • organizations/organization_number/savedQueries/saved_query_id
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/savedQueries/[SAVED_QUERY]";
// Make the request
assetServiceClient.DeleteSavedQuery(name);

DeleteSavedQueryAsync(DeleteSavedQueryRequest, CallSettings)

public virtual Task DeleteSavedQueryAsync(DeleteSavedQueryRequest request, CallSettings callSettings = null)

Deletes a saved query.

Parameters
NameDescription
requestDeleteSavedQueryRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSavedQueryRequest request = new DeleteSavedQueryRequest
{
    SavedQueryName = SavedQueryName.FromProjectSavedQuery("[PROJECT]", "[SAVED_QUERY]"),
};
// Make the request
await assetServiceClient.DeleteSavedQueryAsync(request);

DeleteSavedQueryAsync(DeleteSavedQueryRequest, CancellationToken)

public virtual Task DeleteSavedQueryAsync(DeleteSavedQueryRequest request, CancellationToken cancellationToken)

Deletes a saved query.

Parameters
NameDescription
requestDeleteSavedQueryRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSavedQueryRequest request = new DeleteSavedQueryRequest
{
    SavedQueryName = SavedQueryName.FromProjectSavedQuery("[PROJECT]", "[SAVED_QUERY]"),
};
// Make the request
await assetServiceClient.DeleteSavedQueryAsync(request);

DeleteSavedQueryAsync(SavedQueryName, CallSettings)

public virtual Task DeleteSavedQueryAsync(SavedQueryName name, CallSettings callSettings = null)

Deletes a saved query.

Parameters
NameDescription
nameSavedQueryName

Required. The name of the saved query to delete. It must be in the format of:

  • projects/project_number/savedQueries/saved_query_id
  • folders/folder_number/savedQueries/saved_query_id
  • organizations/organization_number/savedQueries/saved_query_id
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
SavedQueryName name = SavedQueryName.FromProjectSavedQuery("[PROJECT]", "[SAVED_QUERY]");
// Make the request
await assetServiceClient.DeleteSavedQueryAsync(name);

DeleteSavedQueryAsync(SavedQueryName, CancellationToken)

public virtual Task DeleteSavedQueryAsync(SavedQueryName name, CancellationToken cancellationToken)

Deletes a saved query.

Parameters
NameDescription
nameSavedQueryName

Required. The name of the saved query to delete. It must be in the format of:

  • projects/project_number/savedQueries/saved_query_id
  • folders/folder_number/savedQueries/saved_query_id
  • organizations/organization_number/savedQueries/saved_query_id
cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
SavedQueryName name = SavedQueryName.FromProjectSavedQuery("[PROJECT]", "[SAVED_QUERY]");
// Make the request
await assetServiceClient.DeleteSavedQueryAsync(name);

DeleteSavedQueryAsync(string, CallSettings)

public virtual Task DeleteSavedQueryAsync(string name, CallSettings callSettings = null)

Deletes a saved query.

Parameters
NameDescription
namestring

Required. The name of the saved query to delete. It must be in the format of:

  • projects/project_number/savedQueries/saved_query_id
  • folders/folder_number/savedQueries/saved_query_id
  • organizations/organization_number/savedQueries/saved_query_id
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/savedQueries/[SAVED_QUERY]";
// Make the request
await assetServiceClient.DeleteSavedQueryAsync(name);

DeleteSavedQueryAsync(string, CancellationToken)

public virtual Task DeleteSavedQueryAsync(string name, CancellationToken cancellationToken)

Deletes a saved query.

Parameters
NameDescription
namestring

Required. The name of the saved query to delete. It must be in the format of:

  • projects/project_number/savedQueries/saved_query_id
  • folders/folder_number/savedQueries/saved_query_id
  • organizations/organization_number/savedQueries/saved_query_id
cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/savedQueries/[SAVED_QUERY]";
// Make the request
await assetServiceClient.DeleteSavedQueryAsync(name);

ExportAssets(ExportAssetsRequest, CallSettings)

public virtual Operation<ExportAssetsResponse, ExportAssetsRequest> ExportAssets(ExportAssetsRequest request, CallSettings callSettings = null)

Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for BigQuery table destinations, the output table stores the fields in asset Protobuf as columns. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API, which allows you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.

Parameters
NameDescription
requestExportAssetsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationExportAssetsResponseExportAssetsRequest

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
ExportAssetsRequest request = new ExportAssetsRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    ReadTime = new Timestamp(),
    AssetTypes = { "", },
    ContentType = ContentType.Unspecified,
    OutputConfig = new OutputConfig(),
    RelationshipTypes = { "", },
};
// Make the request
Operation<ExportAssetsResponse, ExportAssetsRequest> response = assetServiceClient.ExportAssets(request);

// Poll until the returned long-running operation is complete
Operation<ExportAssetsResponse, ExportAssetsRequest> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
ExportAssetsResponse 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<ExportAssetsResponse, ExportAssetsRequest> retrievedResponse = assetServiceClient.PollOnceExportAssets(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ExportAssetsResponse retrievedResult = retrievedResponse.Result;
}

ExportAssetsAsync(ExportAssetsRequest, CallSettings)

public virtual Task<Operation<ExportAssetsResponse, ExportAssetsRequest>> ExportAssetsAsync(ExportAssetsRequest request, CallSettings callSettings = null)

Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for BigQuery table destinations, the output table stores the fields in asset Protobuf as columns. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API, which allows you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.

Parameters
NameDescription
requestExportAssetsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationExportAssetsResponseExportAssetsRequest

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
ExportAssetsRequest request = new ExportAssetsRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    ReadTime = new Timestamp(),
    AssetTypes = { "", },
    ContentType = ContentType.Unspecified,
    OutputConfig = new OutputConfig(),
    RelationshipTypes = { "", },
};
// Make the request
Operation<ExportAssetsResponse, ExportAssetsRequest> response = await assetServiceClient.ExportAssetsAsync(request);

// Poll until the returned long-running operation is complete
Operation<ExportAssetsResponse, ExportAssetsRequest> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ExportAssetsResponse 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<ExportAssetsResponse, ExportAssetsRequest> retrievedResponse = await assetServiceClient.PollOnceExportAssetsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ExportAssetsResponse retrievedResult = retrievedResponse.Result;
}

ExportAssetsAsync(ExportAssetsRequest, CancellationToken)

public virtual Task<Operation<ExportAssetsResponse, ExportAssetsRequest>> ExportAssetsAsync(ExportAssetsRequest request, CancellationToken cancellationToken)

Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for BigQuery table destinations, the output table stores the fields in asset Protobuf as columns. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API, which allows you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.

Parameters
NameDescription
requestExportAssetsRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationExportAssetsResponseExportAssetsRequest

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
ExportAssetsRequest request = new ExportAssetsRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    ReadTime = new Timestamp(),
    AssetTypes = { "", },
    ContentType = ContentType.Unspecified,
    OutputConfig = new OutputConfig(),
    RelationshipTypes = { "", },
};
// Make the request
Operation<ExportAssetsResponse, ExportAssetsRequest> response = await assetServiceClient.ExportAssetsAsync(request);

// Poll until the returned long-running operation is complete
Operation<ExportAssetsResponse, ExportAssetsRequest> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ExportAssetsResponse 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<ExportAssetsResponse, ExportAssetsRequest> retrievedResponse = await assetServiceClient.PollOnceExportAssetsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ExportAssetsResponse retrievedResult = retrievedResponse.Result;
}

GetFeed(FeedName, CallSettings)

public virtual Feed GetFeed(FeedName name, CallSettings callSettings = null)

Gets details about an asset feed.

Parameters
NameDescription
nameFeedName

Required. The name of the Feed and it must be in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Feed

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
FeedName name = FeedName.FromProjectFeed("[PROJECT]", "[FEED]");
// Make the request
Feed response = assetServiceClient.GetFeed(name);

GetFeed(GetFeedRequest, CallSettings)

public virtual Feed GetFeed(GetFeedRequest request, CallSettings callSettings = null)

Gets details about an asset feed.

Parameters
NameDescription
requestGetFeedRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Feed

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
GetFeedRequest request = new GetFeedRequest
{
    FeedName = FeedName.FromProjectFeed("[PROJECT]", "[FEED]"),
};
// Make the request
Feed response = assetServiceClient.GetFeed(request);

GetFeed(string, CallSettings)

public virtual Feed GetFeed(string name, CallSettings callSettings = null)

Gets details about an asset feed.

Parameters
NameDescription
namestring

Required. The name of the Feed and it must be in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Feed

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/feeds/[FEED]";
// Make the request
Feed response = assetServiceClient.GetFeed(name);

GetFeedAsync(FeedName, CallSettings)

public virtual Task<Feed> GetFeedAsync(FeedName name, CallSettings callSettings = null)

Gets details about an asset feed.

Parameters
NameDescription
nameFeedName

Required. The name of the Feed and it must be in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskFeed

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
FeedName name = FeedName.FromProjectFeed("[PROJECT]", "[FEED]");
// Make the request
Feed response = await assetServiceClient.GetFeedAsync(name);

GetFeedAsync(FeedName, CancellationToken)

public virtual Task<Feed> GetFeedAsync(FeedName name, CancellationToken cancellationToken)

Gets details about an asset feed.

Parameters
NameDescription
nameFeedName

Required. The name of the Feed and it must be in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskFeed

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
FeedName name = FeedName.FromProjectFeed("[PROJECT]", "[FEED]");
// Make the request
Feed response = await assetServiceClient.GetFeedAsync(name);

GetFeedAsync(GetFeedRequest, CallSettings)

public virtual Task<Feed> GetFeedAsync(GetFeedRequest request, CallSettings callSettings = null)

Gets details about an asset feed.

Parameters
NameDescription
requestGetFeedRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskFeed

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
GetFeedRequest request = new GetFeedRequest
{
    FeedName = FeedName.FromProjectFeed("[PROJECT]", "[FEED]"),
};
// Make the request
Feed response = await assetServiceClient.GetFeedAsync(request);

GetFeedAsync(GetFeedRequest, CancellationToken)

public virtual Task<Feed> GetFeedAsync(GetFeedRequest request, CancellationToken cancellationToken)

Gets details about an asset feed.

Parameters
NameDescription
requestGetFeedRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskFeed

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
GetFeedRequest request = new GetFeedRequest
{
    FeedName = FeedName.FromProjectFeed("[PROJECT]", "[FEED]"),
};
// Make the request
Feed response = await assetServiceClient.GetFeedAsync(request);

GetFeedAsync(string, CallSettings)

public virtual Task<Feed> GetFeedAsync(string name, CallSettings callSettings = null)

Gets details about an asset feed.

Parameters
NameDescription
namestring

Required. The name of the Feed and it must be in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskFeed

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/feeds/[FEED]";
// Make the request
Feed response = await assetServiceClient.GetFeedAsync(name);

GetFeedAsync(string, CancellationToken)

public virtual Task<Feed> GetFeedAsync(string name, CancellationToken cancellationToken)

Gets details about an asset feed.

Parameters
NameDescription
namestring

Required. The name of the Feed and it must be in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskFeed

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/feeds/[FEED]";
// Make the request
Feed response = await assetServiceClient.GetFeedAsync(name);

GetSavedQuery(GetSavedQueryRequest, CallSettings)

public virtual SavedQuery GetSavedQuery(GetSavedQueryRequest request, CallSettings callSettings = null)

Gets details about a saved query.

Parameters
NameDescription
requestGetSavedQueryRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SavedQuery

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
GetSavedQueryRequest request = new GetSavedQueryRequest
{
    SavedQueryName = SavedQueryName.FromProjectSavedQuery("[PROJECT]", "[SAVED_QUERY]"),
};
// Make the request
SavedQuery response = assetServiceClient.GetSavedQuery(request);

GetSavedQuery(SavedQueryName, CallSettings)

public virtual SavedQuery GetSavedQuery(SavedQueryName name, CallSettings callSettings = null)

Gets details about a saved query.

Parameters
NameDescription
nameSavedQueryName

Required. The name of the saved query and it must be in the format of:

  • projects/project_number/savedQueries/saved_query_id
  • folders/folder_number/savedQueries/saved_query_id
  • organizations/organization_number/savedQueries/saved_query_id
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SavedQuery

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
SavedQueryName name = SavedQueryName.FromProjectSavedQuery("[PROJECT]", "[SAVED_QUERY]");
// Make the request
SavedQuery response = assetServiceClient.GetSavedQuery(name);

GetSavedQuery(string, CallSettings)

public virtual SavedQuery GetSavedQuery(string name, CallSettings callSettings = null)

Gets details about a saved query.

Parameters
NameDescription
namestring

Required. The name of the saved query and it must be in the format of:

  • projects/project_number/savedQueries/saved_query_id
  • folders/folder_number/savedQueries/saved_query_id
  • organizations/organization_number/savedQueries/saved_query_id
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SavedQuery

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/savedQueries/[SAVED_QUERY]";
// Make the request
SavedQuery response = assetServiceClient.GetSavedQuery(name);

GetSavedQueryAsync(GetSavedQueryRequest, CallSettings)

public virtual Task<SavedQuery> GetSavedQueryAsync(GetSavedQueryRequest request, CallSettings callSettings = null)

Gets details about a saved query.

Parameters
NameDescription
requestGetSavedQueryRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
GetSavedQueryRequest request = new GetSavedQueryRequest
{
    SavedQueryName = SavedQueryName.FromProjectSavedQuery("[PROJECT]", "[SAVED_QUERY]"),
};
// Make the request
SavedQuery response = await assetServiceClient.GetSavedQueryAsync(request);

GetSavedQueryAsync(GetSavedQueryRequest, CancellationToken)

public virtual Task<SavedQuery> GetSavedQueryAsync(GetSavedQueryRequest request, CancellationToken cancellationToken)

Gets details about a saved query.

Parameters
NameDescription
requestGetSavedQueryRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
GetSavedQueryRequest request = new GetSavedQueryRequest
{
    SavedQueryName = SavedQueryName.FromProjectSavedQuery("[PROJECT]", "[SAVED_QUERY]"),
};
// Make the request
SavedQuery response = await assetServiceClient.GetSavedQueryAsync(request);

GetSavedQueryAsync(SavedQueryName, CallSettings)

public virtual Task<SavedQuery> GetSavedQueryAsync(SavedQueryName name, CallSettings callSettings = null)

Gets details about a saved query.

Parameters
NameDescription
nameSavedQueryName

Required. The name of the saved query and it must be in the format of:

  • projects/project_number/savedQueries/saved_query_id
  • folders/folder_number/savedQueries/saved_query_id
  • organizations/organization_number/savedQueries/saved_query_id
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
SavedQueryName name = SavedQueryName.FromProjectSavedQuery("[PROJECT]", "[SAVED_QUERY]");
// Make the request
SavedQuery response = await assetServiceClient.GetSavedQueryAsync(name);

GetSavedQueryAsync(SavedQueryName, CancellationToken)

public virtual Task<SavedQuery> GetSavedQueryAsync(SavedQueryName name, CancellationToken cancellationToken)

Gets details about a saved query.

Parameters
NameDescription
nameSavedQueryName

Required. The name of the saved query and it must be in the format of:

  • projects/project_number/savedQueries/saved_query_id
  • folders/folder_number/savedQueries/saved_query_id
  • organizations/organization_number/savedQueries/saved_query_id
cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
SavedQueryName name = SavedQueryName.FromProjectSavedQuery("[PROJECT]", "[SAVED_QUERY]");
// Make the request
SavedQuery response = await assetServiceClient.GetSavedQueryAsync(name);

GetSavedQueryAsync(string, CallSettings)

public virtual Task<SavedQuery> GetSavedQueryAsync(string name, CallSettings callSettings = null)

Gets details about a saved query.

Parameters
NameDescription
namestring

Required. The name of the saved query and it must be in the format of:

  • projects/project_number/savedQueries/saved_query_id
  • folders/folder_number/savedQueries/saved_query_id
  • organizations/organization_number/savedQueries/saved_query_id
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/savedQueries/[SAVED_QUERY]";
// Make the request
SavedQuery response = await assetServiceClient.GetSavedQueryAsync(name);

GetSavedQueryAsync(string, CancellationToken)

public virtual Task<SavedQuery> GetSavedQueryAsync(string name, CancellationToken cancellationToken)

Gets details about a saved query.

Parameters
NameDescription
namestring

Required. The name of the saved query and it must be in the format of:

  • projects/project_number/savedQueries/saved_query_id
  • folders/folder_number/savedQueries/saved_query_id
  • organizations/organization_number/savedQueries/saved_query_id
cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/savedQueries/[SAVED_QUERY]";
// Make the request
SavedQuery response = await assetServiceClient.GetSavedQueryAsync(name);

ListAssets(IResourceName, string, int?, CallSettings)

public virtual PagedEnumerable<ListAssetsResponse, Asset> ListAssets(IResourceName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists assets with time and resource types and returns paged results in response.

Parameters
NameDescription
parentIResourceName

Required. Name of the organization, folder, or project the assets belong to. Format: "organizations/[organization-number]" (such as "organizations/123"), "projects/[project-id]" (such as "projects/my-project-id"), "projects/[project-number]" (such as "projects/12345"), or "folders/[folder-number]" (such as "folders/12345").

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListAssetsResponseAsset

A pageable sequence of Asset resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
IResourceName parent = new UnparsedResourceName("a/wildcard/resource");
// Make the request
PagedEnumerable<ListAssetsResponse, Asset> response = assetServiceClient.ListAssets(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Asset 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 (ListAssetsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Asset 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<Asset> 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 (Asset 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;

ListAssets(ListAssetsRequest, CallSettings)

public virtual PagedEnumerable<ListAssetsResponse, Asset> ListAssets(ListAssetsRequest request, CallSettings callSettings = null)

Lists assets with time and resource types and returns paged results in response.

Parameters
NameDescription
requestListAssetsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListAssetsResponseAsset

A pageable sequence of Asset resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
ListAssetsRequest request = new ListAssetsRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    ReadTime = new Timestamp(),
    AssetTypes = { "", },
    ContentType = ContentType.Unspecified,
    RelationshipTypes = { "", },
};
// Make the request
PagedEnumerable<ListAssetsResponse, Asset> response = assetServiceClient.ListAssets(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Asset 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 (ListAssetsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Asset 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<Asset> 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 (Asset 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;

ListAssets(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListAssetsResponse, Asset> ListAssets(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists assets with time and resource types and returns paged results in response.

Parameters
NameDescription
parentstring

Required. Name of the organization, folder, or project the assets belong to. Format: "organizations/[organization-number]" (such as "organizations/123"), "projects/[project-id]" (such as "projects/my-project-id"), "projects/[project-number]" (such as "projects/12345"), or "folders/[folder-number]" (such as "folders/12345").

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListAssetsResponseAsset

A pageable sequence of Asset resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
string parent = "a/wildcard/resource";
// Make the request
PagedEnumerable<ListAssetsResponse, Asset> response = assetServiceClient.ListAssets(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Asset 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 (ListAssetsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Asset 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<Asset> 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 (Asset 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;

ListAssetsAsync(IResourceName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAssetsResponse, Asset> ListAssetsAsync(IResourceName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists assets with time and resource types and returns paged results in response.

Parameters
NameDescription
parentIResourceName

Required. Name of the organization, folder, or project the assets belong to. Format: "organizations/[organization-number]" (such as "organizations/123"), "projects/[project-id]" (such as "projects/my-project-id"), "projects/[project-number]" (such as "projects/12345"), or "folders/[folder-number]" (such as "folders/12345").

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListAssetsResponseAsset

A pageable asynchronous sequence of Asset resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
IResourceName parent = new UnparsedResourceName("a/wildcard/resource");
// Make the request
PagedAsyncEnumerable<ListAssetsResponse, Asset> response = assetServiceClient.ListAssetsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Asset 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((ListAssetsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Asset 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<Asset> 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 (Asset 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;

ListAssetsAsync(ListAssetsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListAssetsResponse, Asset> ListAssetsAsync(ListAssetsRequest request, CallSettings callSettings = null)

Lists assets with time and resource types and returns paged results in response.

Parameters
NameDescription
requestListAssetsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListAssetsResponseAsset

A pageable asynchronous sequence of Asset resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
ListAssetsRequest request = new ListAssetsRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    ReadTime = new Timestamp(),
    AssetTypes = { "", },
    ContentType = ContentType.Unspecified,
    RelationshipTypes = { "", },
};
// Make the request
PagedAsyncEnumerable<ListAssetsResponse, Asset> response = assetServiceClient.ListAssetsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Asset 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((ListAssetsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Asset 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<Asset> 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 (Asset 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;

ListAssetsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAssetsResponse, Asset> ListAssetsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists assets with time and resource types and returns paged results in response.

Parameters
NameDescription
parentstring

Required. Name of the organization, folder, or project the assets belong to. Format: "organizations/[organization-number]" (such as "organizations/123"), "projects/[project-id]" (such as "projects/my-project-id"), "projects/[project-number]" (such as "projects/12345"), or "folders/[folder-number]" (such as "folders/12345").

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListAssetsResponseAsset

A pageable asynchronous sequence of Asset resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "a/wildcard/resource";
// Make the request
PagedAsyncEnumerable<ListAssetsResponse, Asset> response = assetServiceClient.ListAssetsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Asset 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((ListAssetsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Asset 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<Asset> 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 (Asset 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;

ListFeeds(ListFeedsRequest, CallSettings)

public virtual ListFeedsResponse ListFeeds(ListFeedsRequest request, CallSettings callSettings = null)

Lists all asset feeds in a parent project/folder/organization.

Parameters
NameDescription
requestListFeedsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ListFeedsResponse

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
ListFeedsRequest request = new ListFeedsRequest { Parent = "", };
// Make the request
ListFeedsResponse response = assetServiceClient.ListFeeds(request);

ListFeeds(string, CallSettings)

public virtual ListFeedsResponse ListFeeds(string parent, CallSettings callSettings = null)

Lists all asset feeds in a parent project/folder/organization.

Parameters
NameDescription
parentstring

Required. The parent project/folder/organization whose feeds are to be listed. It can only be using project/folder/organization number (such as "folders/12345")", or a project ID (such as "projects/my-project-id").

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ListFeedsResponse

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
string parent = "";
// Make the request
ListFeedsResponse response = assetServiceClient.ListFeeds(parent);

ListFeedsAsync(ListFeedsRequest, CallSettings)

public virtual Task<ListFeedsResponse> ListFeedsAsync(ListFeedsRequest request, CallSettings callSettings = null)

Lists all asset feeds in a parent project/folder/organization.

Parameters
NameDescription
requestListFeedsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskListFeedsResponse

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
ListFeedsRequest request = new ListFeedsRequest { Parent = "", };
// Make the request
ListFeedsResponse response = await assetServiceClient.ListFeedsAsync(request);

ListFeedsAsync(ListFeedsRequest, CancellationToken)

public virtual Task<ListFeedsResponse> ListFeedsAsync(ListFeedsRequest request, CancellationToken cancellationToken)

Lists all asset feeds in a parent project/folder/organization.

Parameters
NameDescription
requestListFeedsRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskListFeedsResponse

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
ListFeedsRequest request = new ListFeedsRequest { Parent = "", };
// Make the request
ListFeedsResponse response = await assetServiceClient.ListFeedsAsync(request);

ListFeedsAsync(string, CallSettings)

public virtual Task<ListFeedsResponse> ListFeedsAsync(string parent, CallSettings callSettings = null)

Lists all asset feeds in a parent project/folder/organization.

Parameters
NameDescription
parentstring

Required. The parent project/folder/organization whose feeds are to be listed. It can only be using project/folder/organization number (such as "folders/12345")", or a project ID (such as "projects/my-project-id").

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskListFeedsResponse

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "";
// Make the request
ListFeedsResponse response = await assetServiceClient.ListFeedsAsync(parent);

ListFeedsAsync(string, CancellationToken)

public virtual Task<ListFeedsResponse> ListFeedsAsync(string parent, CancellationToken cancellationToken)

Lists all asset feeds in a parent project/folder/organization.

Parameters
NameDescription
parentstring

Required. The parent project/folder/organization whose feeds are to be listed. It can only be using project/folder/organization number (such as "folders/12345")", or a project ID (such as "projects/my-project-id").

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskListFeedsResponse

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "";
// Make the request
ListFeedsResponse response = await assetServiceClient.ListFeedsAsync(parent);

ListSavedQueries(FolderName, string, int?, CallSettings)

public virtual PagedEnumerable<ListSavedQueriesResponse, SavedQuery> ListSavedQueries(FolderName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all saved queries in a parent project/folder/organization.

Parameters
NameDescription
parentFolderName

Required. The parent project/folder/organization whose savedQueries are to be listed. It can only be using project/folder/organization number (such as "folders/12345")", or a project ID (such as "projects/my-project-id").

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListSavedQueriesResponseSavedQuery

A pageable sequence of SavedQuery resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
FolderName parent = FolderName.FromFolder("[FOLDER]");
// Make the request
PagedEnumerable<ListSavedQueriesResponse, SavedQuery> response = assetServiceClient.ListSavedQueries(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (SavedQuery 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 (ListSavedQueriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SavedQuery 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<SavedQuery> 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 (SavedQuery 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;

ListSavedQueries(OrganizationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListSavedQueriesResponse, SavedQuery> ListSavedQueries(OrganizationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all saved queries in a parent project/folder/organization.

Parameters
NameDescription
parentOrganizationName

Required. The parent project/folder/organization whose savedQueries are to be listed. It can only be using project/folder/organization number (such as "folders/12345")", or a project ID (such as "projects/my-project-id").

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListSavedQueriesResponseSavedQuery

A pageable sequence of SavedQuery resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
OrganizationName parent = OrganizationName.FromOrganization("[ORGANIZATION]");
// Make the request
PagedEnumerable<ListSavedQueriesResponse, SavedQuery> response = assetServiceClient.ListSavedQueries(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (SavedQuery 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 (ListSavedQueriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SavedQuery 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<SavedQuery> 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 (SavedQuery 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;

ListSavedQueries(ProjectName, string, int?, CallSettings)

public virtual PagedEnumerable<ListSavedQueriesResponse, SavedQuery> ListSavedQueries(ProjectName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all saved queries in a parent project/folder/organization.

Parameters
NameDescription
parentProjectName

Required. The parent project/folder/organization whose savedQueries are to be listed. It can only be using project/folder/organization number (such as "folders/12345")", or a project ID (such as "projects/my-project-id").

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListSavedQueriesResponseSavedQuery

A pageable sequence of SavedQuery resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedEnumerable<ListSavedQueriesResponse, SavedQuery> response = assetServiceClient.ListSavedQueries(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (SavedQuery 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 (ListSavedQueriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SavedQuery 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<SavedQuery> 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 (SavedQuery 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;

ListSavedQueries(ListSavedQueriesRequest, CallSettings)

public virtual PagedEnumerable<ListSavedQueriesResponse, SavedQuery> ListSavedQueries(ListSavedQueriesRequest request, CallSettings callSettings = null)

Lists all saved queries in a parent project/folder/organization.

Parameters
NameDescription
requestListSavedQueriesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListSavedQueriesResponseSavedQuery

A pageable sequence of SavedQuery resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
ListSavedQueriesRequest request = new ListSavedQueriesRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListSavedQueriesResponse, SavedQuery> response = assetServiceClient.ListSavedQueries(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (SavedQuery 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 (ListSavedQueriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SavedQuery 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<SavedQuery> 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 (SavedQuery 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;

ListSavedQueries(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListSavedQueriesResponse, SavedQuery> ListSavedQueries(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all saved queries in a parent project/folder/organization.

Parameters
NameDescription
parentstring

Required. The parent project/folder/organization whose savedQueries are to be listed. It can only be using project/folder/organization number (such as "folders/12345")", or a project ID (such as "projects/my-project-id").

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListSavedQueriesResponseSavedQuery

A pageable sequence of SavedQuery resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedEnumerable<ListSavedQueriesResponse, SavedQuery> response = assetServiceClient.ListSavedQueries(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (SavedQuery 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 (ListSavedQueriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SavedQuery 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<SavedQuery> 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 (SavedQuery 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;

ListSavedQueriesAsync(FolderName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListSavedQueriesResponse, SavedQuery> ListSavedQueriesAsync(FolderName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all saved queries in a parent project/folder/organization.

Parameters
NameDescription
parentFolderName

Required. The parent project/folder/organization whose savedQueries are to be listed. It can only be using project/folder/organization number (such as "folders/12345")", or a project ID (such as "projects/my-project-id").

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListSavedQueriesResponseSavedQuery

A pageable asynchronous sequence of SavedQuery resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
FolderName parent = FolderName.FromFolder("[FOLDER]");
// Make the request
PagedAsyncEnumerable<ListSavedQueriesResponse, SavedQuery> response = assetServiceClient.ListSavedQueriesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((SavedQuery 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((ListSavedQueriesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SavedQuery 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<SavedQuery> 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 (SavedQuery 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;

ListSavedQueriesAsync(OrganizationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListSavedQueriesResponse, SavedQuery> ListSavedQueriesAsync(OrganizationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all saved queries in a parent project/folder/organization.

Parameters
NameDescription
parentOrganizationName

Required. The parent project/folder/organization whose savedQueries are to be listed. It can only be using project/folder/organization number (such as "folders/12345")", or a project ID (such as "projects/my-project-id").

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListSavedQueriesResponseSavedQuery

A pageable asynchronous sequence of SavedQuery resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
OrganizationName parent = OrganizationName.FromOrganization("[ORGANIZATION]");
// Make the request
PagedAsyncEnumerable<ListSavedQueriesResponse, SavedQuery> response = assetServiceClient.ListSavedQueriesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((SavedQuery 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((ListSavedQueriesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SavedQuery 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<SavedQuery> 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 (SavedQuery 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;

ListSavedQueriesAsync(ProjectName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListSavedQueriesResponse, SavedQuery> ListSavedQueriesAsync(ProjectName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all saved queries in a parent project/folder/organization.

Parameters
NameDescription
parentProjectName

Required. The parent project/folder/organization whose savedQueries are to be listed. It can only be using project/folder/organization number (such as "folders/12345")", or a project ID (such as "projects/my-project-id").

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListSavedQueriesResponseSavedQuery

A pageable asynchronous sequence of SavedQuery resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedAsyncEnumerable<ListSavedQueriesResponse, SavedQuery> response = assetServiceClient.ListSavedQueriesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((SavedQuery 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((ListSavedQueriesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SavedQuery 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<SavedQuery> 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 (SavedQuery 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;

ListSavedQueriesAsync(ListSavedQueriesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListSavedQueriesResponse, SavedQuery> ListSavedQueriesAsync(ListSavedQueriesRequest request, CallSettings callSettings = null)

Lists all saved queries in a parent project/folder/organization.

Parameters
NameDescription
requestListSavedQueriesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListSavedQueriesResponseSavedQuery

A pageable asynchronous sequence of SavedQuery resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
ListSavedQueriesRequest request = new ListSavedQueriesRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListSavedQueriesResponse, SavedQuery> response = assetServiceClient.ListSavedQueriesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((SavedQuery 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((ListSavedQueriesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SavedQuery 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<SavedQuery> 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 (SavedQuery 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;

ListSavedQueriesAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListSavedQueriesResponse, SavedQuery> ListSavedQueriesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all saved queries in a parent project/folder/organization.

Parameters
NameDescription
parentstring

Required. The parent project/folder/organization whose savedQueries are to be listed. It can only be using project/folder/organization number (such as "folders/12345")", or a project ID (such as "projects/my-project-id").

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListSavedQueriesResponseSavedQuery

A pageable asynchronous sequence of SavedQuery resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedAsyncEnumerable<ListSavedQueriesResponse, SavedQuery> response = assetServiceClient.ListSavedQueriesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((SavedQuery 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((ListSavedQueriesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SavedQuery 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<SavedQuery> 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 (SavedQuery 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;

PollOnceAnalyzeIamPolicyLongrunning(string, CallSettings)

public virtual Operation<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata> PollOnceAnalyzeIamPolicyLongrunning(string operationName, CallSettings callSettings = null)

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

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationAnalyzeIamPolicyLongrunningResponseAnalyzeIamPolicyLongrunningMetadata

The result of polling the operation.

PollOnceAnalyzeIamPolicyLongrunningAsync(string, CallSettings)

public virtual Task<Operation<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningMetadata>> PollOnceAnalyzeIamPolicyLongrunningAsync(string operationName, CallSettings callSettings = null)

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

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationAnalyzeIamPolicyLongrunningResponseAnalyzeIamPolicyLongrunningMetadata

A task representing the result of polling the operation.

PollOnceExportAssets(string, CallSettings)

public virtual Operation<ExportAssetsResponse, ExportAssetsRequest> PollOnceExportAssets(string operationName, CallSettings callSettings = null)

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

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationExportAssetsResponseExportAssetsRequest

The result of polling the operation.

PollOnceExportAssetsAsync(string, CallSettings)

public virtual Task<Operation<ExportAssetsResponse, ExportAssetsRequest>> PollOnceExportAssetsAsync(string operationName, CallSettings callSettings = null)

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

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationExportAssetsResponseExportAssetsRequest

A task representing the result of polling the operation.

QueryAssets(QueryAssetsRequest, CallSettings)

public virtual QueryAssetsResponse QueryAssets(QueryAssetsRequest request, CallSettings callSettings = null)

Issue a job that queries assets using a SQL statement compatible with BigQuery SQL.

If the query execution finishes within timeout and there's no pagination, the full query results will be returned in the QueryAssetsResponse.

Otherwise, full query results can be obtained by issuing extra requests with the job_reference from the a previous QueryAssets call.

Note, the query result has approximately 10 GB limitation enforced by BigQuery. Queries return larger results will result in errors.

Parameters
NameDescription
requestQueryAssetsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
QueryAssetsResponse

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
QueryAssetsRequest request = new QueryAssetsRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Statement = "",
    PageSize = 0,
    PageToken = "",
    Timeout = new Duration(),
    ReadTimeWindow = new TimeWindow(),
    OutputConfig = new QueryAssetsOutputConfig(),
};
// Make the request
QueryAssetsResponse response = assetServiceClient.QueryAssets(request);

QueryAssetsAsync(QueryAssetsRequest, CallSettings)

public virtual Task<QueryAssetsResponse> QueryAssetsAsync(QueryAssetsRequest request, CallSettings callSettings = null)

Issue a job that queries assets using a SQL statement compatible with BigQuery SQL.

If the query execution finishes within timeout and there's no pagination, the full query results will be returned in the QueryAssetsResponse.

Otherwise, full query results can be obtained by issuing extra requests with the job_reference from the a previous QueryAssets call.

Note, the query result has approximately 10 GB limitation enforced by BigQuery. Queries return larger results will result in errors.

Parameters
NameDescription
requestQueryAssetsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueryAssetsResponse

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
QueryAssetsRequest request = new QueryAssetsRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Statement = "",
    PageSize = 0,
    PageToken = "",
    Timeout = new Duration(),
    ReadTimeWindow = new TimeWindow(),
    OutputConfig = new QueryAssetsOutputConfig(),
};
// Make the request
QueryAssetsResponse response = await assetServiceClient.QueryAssetsAsync(request);

QueryAssetsAsync(QueryAssetsRequest, CancellationToken)

public virtual Task<QueryAssetsResponse> QueryAssetsAsync(QueryAssetsRequest request, CancellationToken cancellationToken)

Issue a job that queries assets using a SQL statement compatible with BigQuery SQL.

If the query execution finishes within timeout and there's no pagination, the full query results will be returned in the QueryAssetsResponse.

Otherwise, full query results can be obtained by issuing extra requests with the job_reference from the a previous QueryAssets call.

Note, the query result has approximately 10 GB limitation enforced by BigQuery. Queries return larger results will result in errors.

Parameters
NameDescription
requestQueryAssetsRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueryAssetsResponse

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
QueryAssetsRequest request = new QueryAssetsRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Statement = "",
    PageSize = 0,
    PageToken = "",
    Timeout = new Duration(),
    ReadTimeWindow = new TimeWindow(),
    OutputConfig = new QueryAssetsOutputConfig(),
};
// Make the request
QueryAssetsResponse response = await assetServiceClient.QueryAssetsAsync(request);

SearchAllIamPolicies(SearchAllIamPoliciesRequest, CallSettings)

public virtual PagedEnumerable<SearchAllIamPoliciesResponse, IamPolicySearchResult> SearchAllIamPolicies(SearchAllIamPoliciesRequest request, CallSettings callSettings = null)

Searches all IAM policies within the specified scope, such as a project, folder, or organization. The caller must be granted the cloudasset.assets.searchAllIamPolicies permission on the desired scope, otherwise the request will be rejected.

Parameters
NameDescription
requestSearchAllIamPoliciesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableSearchAllIamPoliciesResponseIamPolicySearchResult

A pageable sequence of IamPolicySearchResult resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
SearchAllIamPoliciesRequest request = new SearchAllIamPoliciesRequest
{
    Scope = "",
    Query = "",
    AssetTypes = { "", },
    OrderBy = "",
};
// Make the request
PagedEnumerable<SearchAllIamPoliciesResponse, IamPolicySearchResult> response = assetServiceClient.SearchAllIamPolicies(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (IamPolicySearchResult 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 (SearchAllIamPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (IamPolicySearchResult 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<IamPolicySearchResult> 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 (IamPolicySearchResult 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;

SearchAllIamPolicies(string, string, string, int?, CallSettings)

public virtual PagedEnumerable<SearchAllIamPoliciesResponse, IamPolicySearchResult> SearchAllIamPolicies(string scope, string query, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Searches all IAM policies within the specified scope, such as a project, folder, or organization. The caller must be granted the cloudasset.assets.searchAllIamPolicies permission on the desired scope, otherwise the request will be rejected.

Parameters
NameDescription
scopestring

Required. A scope can be a project, a folder, or an organization. The search is limited to the IAM policies within the scope. The caller must be granted the cloudasset.assets.searchAllIamPolicies permission on the desired scope.

The allowed values are:

  • projects/{PROJECT_ID} (e.g., "projects/foo-bar")
  • projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
  • folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
  • organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
querystring

Optional. The query statement. See how to construct a query for more information. If not specified or empty, it will search all the IAM policies within the specified scope. Note that the query string is compared against each IAM policy binding, including its principals, roles, and IAM conditions. The returned IAM policies will only contain the bindings that match your query. To learn more about the IAM policy structure, see the IAM policy documentation.

Examples:

  • policy:amy@gmail.com to find IAM policy bindings that specify user "amy@gmail.com".
  • policy:roles/compute.admin to find IAM policy bindings that specify the Compute Admin role.
  • policy:comp* to find IAM policy bindings that contain "comp" as a prefix of any word in the binding.
  • policy.role.permissions:storage.buckets.update to find IAM policy bindings that specify a role containing "storage.buckets.update" permission. Note that if callers don't have iam.roles.get access to a role's included permissions, policy bindings that specify this role will be dropped from the search results.
  • policy.role.permissions:upd* to find IAM policy bindings that specify a role containing "upd" as a prefix of any word in the role permission. Note that if callers don't have iam.roles.get access to a role's included permissions, policy bindings that specify this role will be dropped from the search results.
  • resource:organizations/123456 to find IAM policy bindings that are set on "organizations/123456".
  • resource=//cloudresourcemanager.googleapis.com/projects/myproject to find IAM policy bindings that are set on the project named "myproject".
  • Important to find IAM policy bindings that contain "Important" as a word in any of the searchable fields (except for the included permissions).
  • resource:(instance1 OR instance2) policy:amy to find IAM policy bindings that are set on resources "instance1" or "instance2" and also specify user "amy".
  • roles:roles/compute.admin to find IAM policy bindings that specify the Compute Admin role.
  • memberTypes:user to find IAM policy bindings that contain the principal type "user".
pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableSearchAllIamPoliciesResponseIamPolicySearchResult

A pageable sequence of IamPolicySearchResult resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
string scope = "";
string query = "";
// Make the request
PagedEnumerable<SearchAllIamPoliciesResponse, IamPolicySearchResult> response = assetServiceClient.SearchAllIamPolicies(scope, query);

// Iterate over all response items, lazily performing RPCs as required
foreach (IamPolicySearchResult 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 (SearchAllIamPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (IamPolicySearchResult 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<IamPolicySearchResult> 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 (IamPolicySearchResult 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;

SearchAllIamPoliciesAsync(SearchAllIamPoliciesRequest, CallSettings)

public virtual PagedAsyncEnumerable<SearchAllIamPoliciesResponse, IamPolicySearchResult> SearchAllIamPoliciesAsync(SearchAllIamPoliciesRequest request, CallSettings callSettings = null)

Searches all IAM policies within the specified scope, such as a project, folder, or organization. The caller must be granted the cloudasset.assets.searchAllIamPolicies permission on the desired scope, otherwise the request will be rejected.

Parameters
NameDescription
requestSearchAllIamPoliciesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableSearchAllIamPoliciesResponseIamPolicySearchResult

A pageable asynchronous sequence of IamPolicySearchResult resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
SearchAllIamPoliciesRequest request = new SearchAllIamPoliciesRequest
{
    Scope = "",
    Query = "",
    AssetTypes = { "", },
    OrderBy = "",
};
// Make the request
PagedAsyncEnumerable<SearchAllIamPoliciesResponse, IamPolicySearchResult> response = assetServiceClient.SearchAllIamPoliciesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((IamPolicySearchResult 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((SearchAllIamPoliciesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (IamPolicySearchResult 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<IamPolicySearchResult> 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 (IamPolicySearchResult 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;

SearchAllIamPoliciesAsync(string, string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<SearchAllIamPoliciesResponse, IamPolicySearchResult> SearchAllIamPoliciesAsync(string scope, string query, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Searches all IAM policies within the specified scope, such as a project, folder, or organization. The caller must be granted the cloudasset.assets.searchAllIamPolicies permission on the desired scope, otherwise the request will be rejected.

Parameters
NameDescription
scopestring

Required. A scope can be a project, a folder, or an organization. The search is limited to the IAM policies within the scope. The caller must be granted the cloudasset.assets.searchAllIamPolicies permission on the desired scope.

The allowed values are:

  • projects/{PROJECT_ID} (e.g., "projects/foo-bar")
  • projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
  • folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
  • organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
querystring

Optional. The query statement. See how to construct a query for more information. If not specified or empty, it will search all the IAM policies within the specified scope. Note that the query string is compared against each IAM policy binding, including its principals, roles, and IAM conditions. The returned IAM policies will only contain the bindings that match your query. To learn more about the IAM policy structure, see the IAM policy documentation.

Examples:

  • policy:amy@gmail.com to find IAM policy bindings that specify user "amy@gmail.com".
  • policy:roles/compute.admin to find IAM policy bindings that specify the Compute Admin role.
  • policy:comp* to find IAM policy bindings that contain "comp" as a prefix of any word in the binding.
  • policy.role.permissions:storage.buckets.update to find IAM policy bindings that specify a role containing "storage.buckets.update" permission. Note that if callers don't have iam.roles.get access to a role's included permissions, policy bindings that specify this role will be dropped from the search results.
  • policy.role.permissions:upd* to find IAM policy bindings that specify a role containing "upd" as a prefix of any word in the role permission. Note that if callers don't have iam.roles.get access to a role's included permissions, policy bindings that specify this role will be dropped from the search results.
  • resource:organizations/123456 to find IAM policy bindings that are set on "organizations/123456".
  • resource=//cloudresourcemanager.googleapis.com/projects/myproject to find IAM policy bindings that are set on the project named "myproject".
  • Important to find IAM policy bindings that contain "Important" as a word in any of the searchable fields (except for the included permissions).
  • resource:(instance1 OR instance2) policy:amy to find IAM policy bindings that are set on resources "instance1" or "instance2" and also specify user "amy".
  • roles:roles/compute.admin to find IAM policy bindings that specify the Compute Admin role.
  • memberTypes:user to find IAM policy bindings that contain the principal type "user".
pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableSearchAllIamPoliciesResponseIamPolicySearchResult

A pageable asynchronous sequence of IamPolicySearchResult resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string scope = "";
string query = "";
// Make the request
PagedAsyncEnumerable<SearchAllIamPoliciesResponse, IamPolicySearchResult> response = assetServiceClient.SearchAllIamPoliciesAsync(scope, query);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((IamPolicySearchResult 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((SearchAllIamPoliciesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (IamPolicySearchResult 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<IamPolicySearchResult> 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 (IamPolicySearchResult 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;

SearchAllResources(SearchAllResourcesRequest, CallSettings)

public virtual PagedEnumerable<SearchAllResourcesResponse, ResourceSearchResult> SearchAllResources(SearchAllResourcesRequest request, CallSettings callSettings = null)

Searches all Google Cloud resources within the specified scope, such as a project, folder, or organization. The caller must be granted the cloudasset.assets.searchAllResources permission on the desired scope, otherwise the request will be rejected.

Parameters
NameDescription
requestSearchAllResourcesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableSearchAllResourcesResponseResourceSearchResult

A pageable sequence of ResourceSearchResult resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
SearchAllResourcesRequest request = new SearchAllResourcesRequest
{
    Scope = "",
    Query = "",
    AssetTypes = { "", },
    OrderBy = "",
    ReadMask = new FieldMask(),
};
// Make the request
PagedEnumerable<SearchAllResourcesResponse, ResourceSearchResult> response = assetServiceClient.SearchAllResources(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (ResourceSearchResult 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 (SearchAllResourcesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ResourceSearchResult 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<ResourceSearchResult> 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 (ResourceSearchResult 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;

SearchAllResources(string, string, IEnumerable<string>, string, int?, CallSettings)

public virtual PagedEnumerable<SearchAllResourcesResponse, ResourceSearchResult> SearchAllResources(string scope, string query, IEnumerable<string> assetTypes, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Searches all Google Cloud resources within the specified scope, such as a project, folder, or organization. The caller must be granted the cloudasset.assets.searchAllResources permission on the desired scope, otherwise the request will be rejected.

Parameters
NameDescription
scopestring

Required. A scope can be a project, a folder, or an organization. The search is limited to the resources within the scope. The caller must be granted the cloudasset.assets.searchAllResources permission on the desired scope.

The allowed values are:

  • projects/{PROJECT_ID} (e.g., "projects/foo-bar")
  • projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
  • folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
  • organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
querystring

Optional. The query statement. See how to construct a query for more information. If not specified or empty, it will search all the resources within the specified scope.

Examples:

  • name:Important to find Google Cloud resources whose name contains Important as a word.
  • name=Important to find the Google Cloud resource whose name is exactly Important.
  • displayName:Impor* to find Google Cloud resources whose display name contains Impor as a prefix of any word in the field.
  • location:us-west* to find Google Cloud resources whose location contains both us and west as prefixes.
  • labels:prod to find Google Cloud resources whose labels contain prod as a key or value.
  • labels.env:prod to find Google Cloud resources that have a label env and its value is prod.
  • labels.env:* to find Google Cloud resources that have a label env.
  • tagKeys:env to find Google Cloud resources that have directly attached tags where the TagKey.namespacedName contains env.
  • tagValues:prod* to find Google Cloud resources that have directly attached tags where the TagValue.namespacedName contains a word prefixed by prod.
  • tagValueIds=tagValues/123 to find Google Cloud resources that have directly attached tags where the TagValue.name is exactly tagValues/123.
  • effectiveTagKeys:env to find Google Cloud resources that have directly attached or inherited tags where the TagKey.namespacedName contains env.
  • effectiveTagValues:prod* to find Google Cloud resources that have directly attached or inherited tags where the TagValue.namespacedName contains a word prefixed by prod.
  • effectiveTagValueIds=tagValues/123 to find Google Cloud resources that have directly attached or inherited tags where the TagValue.name is exactly tagValues/123.
  • kmsKey:key to find Google Cloud resources encrypted with a customer-managed encryption key whose name contains key as a word. This field is deprecated. Use the kmsKeys field to retrieve Cloud KMS key information.
  • kmsKeys:key to find Google Cloud resources encrypted with customer-managed encryption keys whose name contains the word key.
  • relationships:instance-group-1 to find Google Cloud resources that have relationships with instance-group-1 in the related resource name.
  • relationships:INSTANCE_TO_INSTANCEGROUP to find Compute Engine instances that have relationships of type INSTANCE_TO_INSTANCEGROUP.
  • relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1 to find Compute Engine instances that have relationships with instance-group-1 in the Compute Engine instance group resource name, for relationship type INSTANCE_TO_INSTANCEGROUP.
  • sccSecurityMarks.key=value to find Cloud resources that are attached with security marks whose key is key and value is value.
  • sccSecurityMarks.key:* to find Cloud resources that are attached with security marks whose key is key.
  • state:ACTIVE to find Google Cloud resources whose state contains ACTIVE as a word.
  • NOT state:ACTIVE to find Google Cloud resources whose state doesn't contain ACTIVE as a word.
  • createTime<1609459200 to find Google Cloud resources that were created before 2021-01-01 00:00:00 UTC. 1609459200 is the epoch timestamp of 2021-01-01 00:00:00 UTC in seconds.
  • updateTime>1609459200 to find Google Cloud resources that were updated after 2021-01-01 00:00:00 UTC. 1609459200 is the epoch timestamp of 2021-01-01 00:00:00 UTC in seconds.
  • Important to find Google Cloud resources that contain Important as a word in any of the searchable fields.
  • Impor* to find Google Cloud resources that contain Impor as a prefix of any word in any of the searchable fields.
  • Important location:(us-west1 OR global) to find Google Cloud resources that contain Important as a word in any of the searchable fields and are also located in the us-west1 region or the global location.
assetTypesIEnumerablestring

Optional. A list of asset types that this request searches for. If empty, it will search all the asset types supported by search APIs.

Regular expressions are also supported. For example:

  • "compute.googleapis.com.*" snapshots resources whose asset type starts with "compute.googleapis.com".
  • ".*Instance" snapshots resources whose asset type ends with "Instance".
  • ".Instance." snapshots resources whose asset type contains "Instance".

See RE2 for all supported regular expression syntax. If the regular expression does not match any supported asset type, an INVALID_ARGUMENT error will be returned.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableSearchAllResourcesResponseResourceSearchResult

A pageable sequence of ResourceSearchResult resources.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
string scope = "";
string query = "";
IEnumerable<string> assetTypes = new string[] { "", };
// Make the request
PagedEnumerable<SearchAllResourcesResponse, ResourceSearchResult> response = assetServiceClient.SearchAllResources(scope, query, assetTypes);

// Iterate over all response items, lazily performing RPCs as required
foreach (ResourceSearchResult 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 (SearchAllResourcesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ResourceSearchResult 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<ResourceSearchResult> 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 (ResourceSearchResult 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;

SearchAllResourcesAsync(SearchAllResourcesRequest, CallSettings)

public virtual PagedAsyncEnumerable<SearchAllResourcesResponse, ResourceSearchResult> SearchAllResourcesAsync(SearchAllResourcesRequest request, CallSettings callSettings = null)

Searches all Google Cloud resources within the specified scope, such as a project, folder, or organization. The caller must be granted the cloudasset.assets.searchAllResources permission on the desired scope, otherwise the request will be rejected.

Parameters
NameDescription
requestSearchAllResourcesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableSearchAllResourcesResponseResourceSearchResult

A pageable asynchronous sequence of ResourceSearchResult resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
SearchAllResourcesRequest request = new SearchAllResourcesRequest
{
    Scope = "",
    Query = "",
    AssetTypes = { "", },
    OrderBy = "",
    ReadMask = new FieldMask(),
};
// Make the request
PagedAsyncEnumerable<SearchAllResourcesResponse, ResourceSearchResult> response = assetServiceClient.SearchAllResourcesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ResourceSearchResult 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((SearchAllResourcesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ResourceSearchResult 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<ResourceSearchResult> 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 (ResourceSearchResult 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;

SearchAllResourcesAsync(string, string, IEnumerable<string>, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<SearchAllResourcesResponse, ResourceSearchResult> SearchAllResourcesAsync(string scope, string query, IEnumerable<string> assetTypes, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Searches all Google Cloud resources within the specified scope, such as a project, folder, or organization. The caller must be granted the cloudasset.assets.searchAllResources permission on the desired scope, otherwise the request will be rejected.

Parameters
NameDescription
scopestring

Required. A scope can be a project, a folder, or an organization. The search is limited to the resources within the scope. The caller must be granted the cloudasset.assets.searchAllResources permission on the desired scope.

The allowed values are:

  • projects/{PROJECT_ID} (e.g., "projects/foo-bar")
  • projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
  • folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
  • organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
querystring

Optional. The query statement. See how to construct a query for more information. If not specified or empty, it will search all the resources within the specified scope.

Examples:

  • name:Important to find Google Cloud resources whose name contains Important as a word.
  • name=Important to find the Google Cloud resource whose name is exactly Important.
  • displayName:Impor* to find Google Cloud resources whose display name contains Impor as a prefix of any word in the field.
  • location:us-west* to find Google Cloud resources whose location contains both us and west as prefixes.
  • labels:prod to find Google Cloud resources whose labels contain prod as a key or value.
  • labels.env:prod to find Google Cloud resources that have a label env and its value is prod.
  • labels.env:* to find Google Cloud resources that have a label env.
  • tagKeys:env to find Google Cloud resources that have directly attached tags where the TagKey.namespacedName contains env.
  • tagValues:prod* to find Google Cloud resources that have directly attached tags where the TagValue.namespacedName contains a word prefixed by prod.
  • tagValueIds=tagValues/123 to find Google Cloud resources that have directly attached tags where the TagValue.name is exactly tagValues/123.
  • effectiveTagKeys:env to find Google Cloud resources that have directly attached or inherited tags where the TagKey.namespacedName contains env.
  • effectiveTagValues:prod* to find Google Cloud resources that have directly attached or inherited tags where the TagValue.namespacedName contains a word prefixed by prod.
  • effectiveTagValueIds=tagValues/123 to find Google Cloud resources that have directly attached or inherited tags where the TagValue.name is exactly tagValues/123.
  • kmsKey:key to find Google Cloud resources encrypted with a customer-managed encryption key whose name contains key as a word. This field is deprecated. Use the kmsKeys field to retrieve Cloud KMS key information.
  • kmsKeys:key to find Google Cloud resources encrypted with customer-managed encryption keys whose name contains the word key.
  • relationships:instance-group-1 to find Google Cloud resources that have relationships with instance-group-1 in the related resource name.
  • relationships:INSTANCE_TO_INSTANCEGROUP to find Compute Engine instances that have relationships of type INSTANCE_TO_INSTANCEGROUP.
  • relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1 to find Compute Engine instances that have relationships with instance-group-1 in the Compute Engine instance group resource name, for relationship type INSTANCE_TO_INSTANCEGROUP.
  • sccSecurityMarks.key=value to find Cloud resources that are attached with security marks whose key is key and value is value.
  • sccSecurityMarks.key:* to find Cloud resources that are attached with security marks whose key is key.
  • state:ACTIVE to find Google Cloud resources whose state contains ACTIVE as a word.
  • NOT state:ACTIVE to find Google Cloud resources whose state doesn't contain ACTIVE as a word.
  • createTime<1609459200 to find Google Cloud resources that were created before 2021-01-01 00:00:00 UTC. 1609459200 is the epoch timestamp of 2021-01-01 00:00:00 UTC in seconds.
  • updateTime>1609459200 to find Google Cloud resources that were updated after 2021-01-01 00:00:00 UTC. 1609459200 is the epoch timestamp of 2021-01-01 00:00:00 UTC in seconds.
  • Important to find Google Cloud resources that contain Important as a word in any of the searchable fields.
  • Impor* to find Google Cloud resources that contain Impor as a prefix of any word in any of the searchable fields.
  • Important location:(us-west1 OR global) to find Google Cloud resources that contain Important as a word in any of the searchable fields and are also located in the us-west1 region or the global location.
assetTypesIEnumerablestring

Optional. A list of asset types that this request searches for. If empty, it will search all the asset types supported by search APIs.

Regular expressions are also supported. For example:

  • "compute.googleapis.com.*" snapshots resources whose asset type starts with "compute.googleapis.com".
  • ".*Instance" snapshots resources whose asset type ends with "Instance".
  • ".Instance." snapshots resources whose asset type contains "Instance".

See RE2 for all supported regular expression syntax. If the regular expression does not match any supported asset type, an INVALID_ARGUMENT error will be returned.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableSearchAllResourcesResponseResourceSearchResult

A pageable asynchronous sequence of ResourceSearchResult resources.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
string scope = "";
string query = "";
IEnumerable<string> assetTypes = new string[] { "", };
// Make the request
PagedAsyncEnumerable<SearchAllResourcesResponse, ResourceSearchResult> response = assetServiceClient.SearchAllResourcesAsync(scope, query, assetTypes);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ResourceSearchResult 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((SearchAllResourcesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ResourceSearchResult 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<ResourceSearchResult> 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 (ResourceSearchResult 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;

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

UpdateFeed(Feed, CallSettings)

public virtual Feed UpdateFeed(Feed feed, CallSettings callSettings = null)

Updates an asset feed configuration.

Parameters
NameDescription
feedFeed

Required. The new values of feed details. It must match an existing feed and the field name must be in the format of: projects/project_number/feeds/feed_id or folders/folder_number/feeds/feed_id or organizations/organization_number/feeds/feed_id.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Feed

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
Feed feed = new Feed();
// Make the request
Feed response = assetServiceClient.UpdateFeed(feed);

UpdateFeed(UpdateFeedRequest, CallSettings)

public virtual Feed UpdateFeed(UpdateFeedRequest request, CallSettings callSettings = null)

Updates an asset feed configuration.

Parameters
NameDescription
requestUpdateFeedRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Feed

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
UpdateFeedRequest request = new UpdateFeedRequest
{
    Feed = new Feed(),
    UpdateMask = new FieldMask(),
};
// Make the request
Feed response = assetServiceClient.UpdateFeed(request);

UpdateFeedAsync(Feed, CallSettings)

public virtual Task<Feed> UpdateFeedAsync(Feed feed, CallSettings callSettings = null)

Updates an asset feed configuration.

Parameters
NameDescription
feedFeed

Required. The new values of feed details. It must match an existing feed and the field name must be in the format of: projects/project_number/feeds/feed_id or folders/folder_number/feeds/feed_id or organizations/organization_number/feeds/feed_id.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskFeed

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
Feed feed = new Feed();
// Make the request
Feed response = await assetServiceClient.UpdateFeedAsync(feed);

UpdateFeedAsync(Feed, CancellationToken)

public virtual Task<Feed> UpdateFeedAsync(Feed feed, CancellationToken cancellationToken)

Updates an asset feed configuration.

Parameters
NameDescription
feedFeed

Required. The new values of feed details. It must match an existing feed and the field name must be in the format of: projects/project_number/feeds/feed_id or folders/folder_number/feeds/feed_id or organizations/organization_number/feeds/feed_id.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskFeed

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
Feed feed = new Feed();
// Make the request
Feed response = await assetServiceClient.UpdateFeedAsync(feed);

UpdateFeedAsync(UpdateFeedRequest, CallSettings)

public virtual Task<Feed> UpdateFeedAsync(UpdateFeedRequest request, CallSettings callSettings = null)

Updates an asset feed configuration.

Parameters
NameDescription
requestUpdateFeedRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskFeed

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateFeedRequest request = new UpdateFeedRequest
{
    Feed = new Feed(),
    UpdateMask = new FieldMask(),
};
// Make the request
Feed response = await assetServiceClient.UpdateFeedAsync(request);

UpdateFeedAsync(UpdateFeedRequest, CancellationToken)

public virtual Task<Feed> UpdateFeedAsync(UpdateFeedRequest request, CancellationToken cancellationToken)

Updates an asset feed configuration.

Parameters
NameDescription
requestUpdateFeedRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskFeed

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateFeedRequest request = new UpdateFeedRequest
{
    Feed = new Feed(),
    UpdateMask = new FieldMask(),
};
// Make the request
Feed response = await assetServiceClient.UpdateFeedAsync(request);

UpdateSavedQuery(SavedQuery, FieldMask, CallSettings)

public virtual SavedQuery UpdateSavedQuery(SavedQuery savedQuery, FieldMask updateMask, CallSettings callSettings = null)

Updates a saved query.

Parameters
NameDescription
savedQuerySavedQuery

Required. The saved query to update.

The saved query's name field is used to identify the one to update, which has format as below:

  • projects/project_number/savedQueries/saved_query_id
  • folders/folder_number/savedQueries/saved_query_id
  • organizations/organization_number/savedQueries/saved_query_id
updateMaskFieldMask

Required. The list of fields to update.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SavedQuery

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
SavedQuery savedQuery = new SavedQuery();
FieldMask updateMask = new FieldMask();
// Make the request
SavedQuery response = assetServiceClient.UpdateSavedQuery(savedQuery, updateMask);

UpdateSavedQuery(UpdateSavedQueryRequest, CallSettings)

public virtual SavedQuery UpdateSavedQuery(UpdateSavedQueryRequest request, CallSettings callSettings = null)

Updates a saved query.

Parameters
NameDescription
requestUpdateSavedQueryRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SavedQuery

The RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = AssetServiceClient.Create();
// Initialize request argument(s)
UpdateSavedQueryRequest request = new UpdateSavedQueryRequest
{
    SavedQuery = new SavedQuery(),
    UpdateMask = new FieldMask(),
};
// Make the request
SavedQuery response = assetServiceClient.UpdateSavedQuery(request);

UpdateSavedQueryAsync(SavedQuery, FieldMask, CallSettings)

public virtual Task<SavedQuery> UpdateSavedQueryAsync(SavedQuery savedQuery, FieldMask updateMask, CallSettings callSettings = null)

Updates a saved query.

Parameters
NameDescription
savedQuerySavedQuery

Required. The saved query to update.

The saved query's name field is used to identify the one to update, which has format as below:

  • projects/project_number/savedQueries/saved_query_id
  • folders/folder_number/savedQueries/saved_query_id
  • organizations/organization_number/savedQueries/saved_query_id
updateMaskFieldMask

Required. The list of fields to update.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
SavedQuery savedQuery = new SavedQuery();
FieldMask updateMask = new FieldMask();
// Make the request
SavedQuery response = await assetServiceClient.UpdateSavedQueryAsync(savedQuery, updateMask);

UpdateSavedQueryAsync(SavedQuery, FieldMask, CancellationToken)

public virtual Task<SavedQuery> UpdateSavedQueryAsync(SavedQuery savedQuery, FieldMask updateMask, CancellationToken cancellationToken)

Updates a saved query.

Parameters
NameDescription
savedQuerySavedQuery

Required. The saved query to update.

The saved query's name field is used to identify the one to update, which has format as below:

  • projects/project_number/savedQueries/saved_query_id
  • folders/folder_number/savedQueries/saved_query_id
  • organizations/organization_number/savedQueries/saved_query_id
updateMaskFieldMask

Required. The list of fields to update.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
SavedQuery savedQuery = new SavedQuery();
FieldMask updateMask = new FieldMask();
// Make the request
SavedQuery response = await assetServiceClient.UpdateSavedQueryAsync(savedQuery, updateMask);

UpdateSavedQueryAsync(UpdateSavedQueryRequest, CallSettings)

public virtual Task<SavedQuery> UpdateSavedQueryAsync(UpdateSavedQueryRequest request, CallSettings callSettings = null)

Updates a saved query.

Parameters
NameDescription
requestUpdateSavedQueryRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSavedQueryRequest request = new UpdateSavedQueryRequest
{
    SavedQuery = new SavedQuery(),
    UpdateMask = new FieldMask(),
};
// Make the request
SavedQuery response = await assetServiceClient.UpdateSavedQueryAsync(request);

UpdateSavedQueryAsync(UpdateSavedQueryRequest, CancellationToken)

public virtual Task<SavedQuery> UpdateSavedQueryAsync(UpdateSavedQueryRequest request, CancellationToken cancellationToken)

Updates a saved query.

Parameters
NameDescription
requestUpdateSavedQueryRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskSavedQuery

A Task containing the RPC response.

Example
// Create client
AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSavedQueryRequest request = new UpdateSavedQueryRequest
{
    SavedQuery = new SavedQuery(),
    UpdateMask = new FieldMask(),
};
// Make the request
SavedQuery response = await assetServiceClient.UpdateSavedQueryAsync(request);