Class WebSecurityScannerClient (2.0.0)

public abstract class WebSecurityScannerClient

WebSecurityScanner client wrapper, for convenient use.

Inheritance

Object > WebSecurityScannerClient

Namespace

Google.Cloud.WebSecurityScanner.V1

Assembly

Google.Cloud.WebSecurityScanner.V1.dll

Remarks

Web Security Scanner Service identifies security vulnerabilities in web applications hosted on Google Cloud. It crawls your application, and attempts to exercise as many user inputs and event handlers as possible.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default WebSecurityScanner scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default WebSecurityScanner scopes are:

GrpcClient

public virtual WebSecurityScanner.WebSecurityScannerClient GrpcClient { get; }

The underlying gRPC WebSecurityScanner client

Property Value
TypeDescription
WebSecurityScanner.WebSecurityScannerClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static WebSecurityScannerClient Create()

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

Returns
TypeDescription
WebSecurityScannerClient

The created WebSecurityScannerClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<WebSecurityScannerClient>

The task representing the created WebSecurityScannerClient.

CreateScanConfig(CreateScanConfigRequest, CallSettings)

public virtual ScanConfig CreateScanConfig(CreateScanConfigRequest request, CallSettings callSettings = null)

Creates a new ScanConfig.

Parameters
NameDescription
requestCreateScanConfigRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ScanConfig

The RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.Create();
// Initialize request argument(s)
CreateScanConfigRequest request = new CreateScanConfigRequest
{
    Parent = "",
    ScanConfig = new ScanConfig(),
};
// Make the request
ScanConfig response = webSecurityScannerClient.CreateScanConfig(request);

CreateScanConfigAsync(CreateScanConfigRequest, CallSettings)

public virtual Task<ScanConfig> CreateScanConfigAsync(CreateScanConfigRequest request, CallSettings callSettings = null)

Creates a new ScanConfig.

Parameters
NameDescription
requestCreateScanConfigRequest

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<ScanConfig>

A Task containing the RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
CreateScanConfigRequest request = new CreateScanConfigRequest
{
    Parent = "",
    ScanConfig = new ScanConfig(),
};
// Make the request
ScanConfig response = await webSecurityScannerClient.CreateScanConfigAsync(request);

CreateScanConfigAsync(CreateScanConfigRequest, CancellationToken)

public virtual Task<ScanConfig> CreateScanConfigAsync(CreateScanConfigRequest request, CancellationToken cancellationToken)

Creates a new ScanConfig.

Parameters
NameDescription
requestCreateScanConfigRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ScanConfig>

A Task containing the RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
CreateScanConfigRequest request = new CreateScanConfigRequest
{
    Parent = "",
    ScanConfig = new ScanConfig(),
};
// Make the request
ScanConfig response = await webSecurityScannerClient.CreateScanConfigAsync(request);

DeleteScanConfig(DeleteScanConfigRequest, CallSettings)

public virtual void DeleteScanConfig(DeleteScanConfigRequest request, CallSettings callSettings = null)

Deletes an existing ScanConfig and its child resources.

Parameters
NameDescription
requestDeleteScanConfigRequest

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
WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.Create();
// Initialize request argument(s)
DeleteScanConfigRequest request = new DeleteScanConfigRequest { Name = "", };
// Make the request
webSecurityScannerClient.DeleteScanConfig(request);

DeleteScanConfigAsync(DeleteScanConfigRequest, CallSettings)

public virtual Task DeleteScanConfigAsync(DeleteScanConfigRequest request, CallSettings callSettings = null)

Deletes an existing ScanConfig and its child resources.

Parameters
NameDescription
requestDeleteScanConfigRequest

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
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
DeleteScanConfigRequest request = new DeleteScanConfigRequest { Name = "", };
// Make the request
await webSecurityScannerClient.DeleteScanConfigAsync(request);

DeleteScanConfigAsync(DeleteScanConfigRequest, CancellationToken)

public virtual Task DeleteScanConfigAsync(DeleteScanConfigRequest request, CancellationToken cancellationToken)

Deletes an existing ScanConfig and its child resources.

Parameters
NameDescription
requestDeleteScanConfigRequest

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
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
DeleteScanConfigRequest request = new DeleteScanConfigRequest { Name = "", };
// Make the request
await webSecurityScannerClient.DeleteScanConfigAsync(request);

GetFinding(GetFindingRequest, CallSettings)

public virtual Finding GetFinding(GetFindingRequest request, CallSettings callSettings = null)

Gets a Finding.

Parameters
NameDescription
requestGetFindingRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Finding

The RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.Create();
// Initialize request argument(s)
GetFindingRequest request = new GetFindingRequest { Name = "", };
// Make the request
Finding response = webSecurityScannerClient.GetFinding(request);

GetFindingAsync(GetFindingRequest, CallSettings)

public virtual Task<Finding> GetFindingAsync(GetFindingRequest request, CallSettings callSettings = null)

Gets a Finding.

Parameters
NameDescription
requestGetFindingRequest

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<Finding>

A Task containing the RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
GetFindingRequest request = new GetFindingRequest { Name = "", };
// Make the request
Finding response = await webSecurityScannerClient.GetFindingAsync(request);

GetFindingAsync(GetFindingRequest, CancellationToken)

public virtual Task<Finding> GetFindingAsync(GetFindingRequest request, CancellationToken cancellationToken)

Gets a Finding.

Parameters
NameDescription
requestGetFindingRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Finding>

A Task containing the RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
GetFindingRequest request = new GetFindingRequest { Name = "", };
// Make the request
Finding response = await webSecurityScannerClient.GetFindingAsync(request);

GetScanConfig(GetScanConfigRequest, CallSettings)

public virtual ScanConfig GetScanConfig(GetScanConfigRequest request, CallSettings callSettings = null)

Gets a ScanConfig.

Parameters
NameDescription
requestGetScanConfigRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ScanConfig

The RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.Create();
// Initialize request argument(s)
GetScanConfigRequest request = new GetScanConfigRequest { Name = "", };
// Make the request
ScanConfig response = webSecurityScannerClient.GetScanConfig(request);

GetScanConfigAsync(GetScanConfigRequest, CallSettings)

public virtual Task<ScanConfig> GetScanConfigAsync(GetScanConfigRequest request, CallSettings callSettings = null)

Gets a ScanConfig.

Parameters
NameDescription
requestGetScanConfigRequest

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<ScanConfig>

A Task containing the RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
GetScanConfigRequest request = new GetScanConfigRequest { Name = "", };
// Make the request
ScanConfig response = await webSecurityScannerClient.GetScanConfigAsync(request);

GetScanConfigAsync(GetScanConfigRequest, CancellationToken)

public virtual Task<ScanConfig> GetScanConfigAsync(GetScanConfigRequest request, CancellationToken cancellationToken)

Gets a ScanConfig.

Parameters
NameDescription
requestGetScanConfigRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ScanConfig>

A Task containing the RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
GetScanConfigRequest request = new GetScanConfigRequest { Name = "", };
// Make the request
ScanConfig response = await webSecurityScannerClient.GetScanConfigAsync(request);

GetScanRun(GetScanRunRequest, CallSettings)

public virtual ScanRun GetScanRun(GetScanRunRequest request, CallSettings callSettings = null)

Gets a ScanRun.

Parameters
NameDescription
requestGetScanRunRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ScanRun

The RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.Create();
// Initialize request argument(s)
GetScanRunRequest request = new GetScanRunRequest { Name = "", };
// Make the request
ScanRun response = webSecurityScannerClient.GetScanRun(request);

GetScanRunAsync(GetScanRunRequest, CallSettings)

public virtual Task<ScanRun> GetScanRunAsync(GetScanRunRequest request, CallSettings callSettings = null)

Gets a ScanRun.

Parameters
NameDescription
requestGetScanRunRequest

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<ScanRun>

A Task containing the RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
GetScanRunRequest request = new GetScanRunRequest { Name = "", };
// Make the request
ScanRun response = await webSecurityScannerClient.GetScanRunAsync(request);

GetScanRunAsync(GetScanRunRequest, CancellationToken)

public virtual Task<ScanRun> GetScanRunAsync(GetScanRunRequest request, CancellationToken cancellationToken)

Gets a ScanRun.

Parameters
NameDescription
requestGetScanRunRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ScanRun>

A Task containing the RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
GetScanRunRequest request = new GetScanRunRequest { Name = "", };
// Make the request
ScanRun response = await webSecurityScannerClient.GetScanRunAsync(request);

ListCrawledUrls(ListCrawledUrlsRequest, CallSettings)

public virtual PagedEnumerable<ListCrawledUrlsResponse, CrawledUrl> ListCrawledUrls(ListCrawledUrlsRequest request, CallSettings callSettings = null)

List CrawledUrls under a given ScanRun.

Parameters
NameDescription
requestListCrawledUrlsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListCrawledUrlsResponse, CrawledUrl>

A pageable sequence of CrawledUrl resources.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.Create();
// Initialize request argument(s)
ListCrawledUrlsRequest request = new ListCrawledUrlsRequest { Parent = "", };
// Make the request
PagedEnumerable<ListCrawledUrlsResponse, CrawledUrl> response = webSecurityScannerClient.ListCrawledUrls(request);

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

ListCrawledUrlsAsync(ListCrawledUrlsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListCrawledUrlsResponse, CrawledUrl> ListCrawledUrlsAsync(ListCrawledUrlsRequest request, CallSettings callSettings = null)

List CrawledUrls under a given ScanRun.

Parameters
NameDescription
requestListCrawledUrlsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListCrawledUrlsResponse, CrawledUrl>

A pageable asynchronous sequence of CrawledUrl resources.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
ListCrawledUrlsRequest request = new ListCrawledUrlsRequest { Parent = "", };
// Make the request
PagedAsyncEnumerable<ListCrawledUrlsResponse, CrawledUrl> response = webSecurityScannerClient.ListCrawledUrlsAsync(request);

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

ListFindings(ListFindingsRequest, CallSettings)

public virtual PagedEnumerable<ListFindingsResponse, Finding> ListFindings(ListFindingsRequest request, CallSettings callSettings = null)

List Findings under a given ScanRun.

Parameters
NameDescription
requestListFindingsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListFindingsResponse, Finding>

A pageable sequence of Finding resources.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.Create();
// Initialize request argument(s)
ListFindingsRequest request = new ListFindingsRequest
{
    Parent = "",
    Filter = "",
};
// Make the request
PagedEnumerable<ListFindingsResponse, Finding> response = webSecurityScannerClient.ListFindings(request);

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

ListFindingsAsync(ListFindingsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListFindingsResponse, Finding> ListFindingsAsync(ListFindingsRequest request, CallSettings callSettings = null)

List Findings under a given ScanRun.

Parameters
NameDescription
requestListFindingsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListFindingsResponse, Finding>

A pageable asynchronous sequence of Finding resources.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
ListFindingsRequest request = new ListFindingsRequest
{
    Parent = "",
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListFindingsResponse, Finding> response = webSecurityScannerClient.ListFindingsAsync(request);

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

ListFindingTypeStats(ListFindingTypeStatsRequest, CallSettings)

public virtual ListFindingTypeStatsResponse ListFindingTypeStats(ListFindingTypeStatsRequest request, CallSettings callSettings = null)

List all FindingTypeStats under a given ScanRun.

Parameters
NameDescription
requestListFindingTypeStatsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ListFindingTypeStatsResponse

The RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.Create();
// Initialize request argument(s)
ListFindingTypeStatsRequest request = new ListFindingTypeStatsRequest { Parent = "", };
// Make the request
ListFindingTypeStatsResponse response = webSecurityScannerClient.ListFindingTypeStats(request);

ListFindingTypeStatsAsync(ListFindingTypeStatsRequest, CallSettings)

public virtual Task<ListFindingTypeStatsResponse> ListFindingTypeStatsAsync(ListFindingTypeStatsRequest request, CallSettings callSettings = null)

List all FindingTypeStats under a given ScanRun.

Parameters
NameDescription
requestListFindingTypeStatsRequest

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<ListFindingTypeStatsResponse>

A Task containing the RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
ListFindingTypeStatsRequest request = new ListFindingTypeStatsRequest { Parent = "", };
// Make the request
ListFindingTypeStatsResponse response = await webSecurityScannerClient.ListFindingTypeStatsAsync(request);

ListFindingTypeStatsAsync(ListFindingTypeStatsRequest, CancellationToken)

public virtual Task<ListFindingTypeStatsResponse> ListFindingTypeStatsAsync(ListFindingTypeStatsRequest request, CancellationToken cancellationToken)

List all FindingTypeStats under a given ScanRun.

Parameters
NameDescription
requestListFindingTypeStatsRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ListFindingTypeStatsResponse>

A Task containing the RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
ListFindingTypeStatsRequest request = new ListFindingTypeStatsRequest { Parent = "", };
// Make the request
ListFindingTypeStatsResponse response = await webSecurityScannerClient.ListFindingTypeStatsAsync(request);

ListScanConfigs(ListScanConfigsRequest, CallSettings)

public virtual PagedEnumerable<ListScanConfigsResponse, ScanConfig> ListScanConfigs(ListScanConfigsRequest request, CallSettings callSettings = null)

Lists ScanConfigs under a given project.

Parameters
NameDescription
requestListScanConfigsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListScanConfigsResponse, ScanConfig>

A pageable sequence of ScanConfig resources.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.Create();
// Initialize request argument(s)
ListScanConfigsRequest request = new ListScanConfigsRequest { Parent = "", };
// Make the request
PagedEnumerable<ListScanConfigsResponse, ScanConfig> response = webSecurityScannerClient.ListScanConfigs(request);

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

ListScanConfigsAsync(ListScanConfigsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListScanConfigsResponse, ScanConfig> ListScanConfigsAsync(ListScanConfigsRequest request, CallSettings callSettings = null)

Lists ScanConfigs under a given project.

Parameters
NameDescription
requestListScanConfigsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListScanConfigsResponse, ScanConfig>

A pageable asynchronous sequence of ScanConfig resources.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
ListScanConfigsRequest request = new ListScanConfigsRequest { Parent = "", };
// Make the request
PagedAsyncEnumerable<ListScanConfigsResponse, ScanConfig> response = webSecurityScannerClient.ListScanConfigsAsync(request);

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

ListScanRuns(ListScanRunsRequest, CallSettings)

public virtual PagedEnumerable<ListScanRunsResponse, ScanRun> ListScanRuns(ListScanRunsRequest request, CallSettings callSettings = null)

Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.

Parameters
NameDescription
requestListScanRunsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListScanRunsResponse, ScanRun>

A pageable sequence of ScanRun resources.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.Create();
// Initialize request argument(s)
ListScanRunsRequest request = new ListScanRunsRequest { Parent = "", };
// Make the request
PagedEnumerable<ListScanRunsResponse, ScanRun> response = webSecurityScannerClient.ListScanRuns(request);

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

ListScanRunsAsync(ListScanRunsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListScanRunsResponse, ScanRun> ListScanRunsAsync(ListScanRunsRequest request, CallSettings callSettings = null)

Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.

Parameters
NameDescription
requestListScanRunsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListScanRunsResponse, ScanRun>

A pageable asynchronous sequence of ScanRun resources.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
ListScanRunsRequest request = new ListScanRunsRequest { Parent = "", };
// Make the request
PagedAsyncEnumerable<ListScanRunsResponse, ScanRun> response = webSecurityScannerClient.ListScanRunsAsync(request);

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

StartScanRun(StartScanRunRequest, CallSettings)

public virtual ScanRun StartScanRun(StartScanRunRequest request, CallSettings callSettings = null)

Start a ScanRun according to the given ScanConfig.

Parameters
NameDescription
requestStartScanRunRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ScanRun

The RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.Create();
// Initialize request argument(s)
StartScanRunRequest request = new StartScanRunRequest { Name = "", };
// Make the request
ScanRun response = webSecurityScannerClient.StartScanRun(request);

StartScanRunAsync(StartScanRunRequest, CallSettings)

public virtual Task<ScanRun> StartScanRunAsync(StartScanRunRequest request, CallSettings callSettings = null)

Start a ScanRun according to the given ScanConfig.

Parameters
NameDescription
requestStartScanRunRequest

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<ScanRun>

A Task containing the RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
StartScanRunRequest request = new StartScanRunRequest { Name = "", };
// Make the request
ScanRun response = await webSecurityScannerClient.StartScanRunAsync(request);

StartScanRunAsync(StartScanRunRequest, CancellationToken)

public virtual Task<ScanRun> StartScanRunAsync(StartScanRunRequest request, CancellationToken cancellationToken)

Start a ScanRun according to the given ScanConfig.

Parameters
NameDescription
requestStartScanRunRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ScanRun>

A Task containing the RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
StartScanRunRequest request = new StartScanRunRequest { Name = "", };
// Make the request
ScanRun response = await webSecurityScannerClient.StartScanRunAsync(request);

StopScanRun(StopScanRunRequest, CallSettings)

public virtual ScanRun StopScanRun(StopScanRunRequest request, CallSettings callSettings = null)

Stops a ScanRun. The stopped ScanRun is returned.

Parameters
NameDescription
requestStopScanRunRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ScanRun

The RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.Create();
// Initialize request argument(s)
StopScanRunRequest request = new StopScanRunRequest { Name = "", };
// Make the request
ScanRun response = webSecurityScannerClient.StopScanRun(request);

StopScanRunAsync(StopScanRunRequest, CallSettings)

public virtual Task<ScanRun> StopScanRunAsync(StopScanRunRequest request, CallSettings callSettings = null)

Stops a ScanRun. The stopped ScanRun is returned.

Parameters
NameDescription
requestStopScanRunRequest

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<ScanRun>

A Task containing the RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
StopScanRunRequest request = new StopScanRunRequest { Name = "", };
// Make the request
ScanRun response = await webSecurityScannerClient.StopScanRunAsync(request);

StopScanRunAsync(StopScanRunRequest, CancellationToken)

public virtual Task<ScanRun> StopScanRunAsync(StopScanRunRequest request, CancellationToken cancellationToken)

Stops a ScanRun. The stopped ScanRun is returned.

Parameters
NameDescription
requestStopScanRunRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ScanRun>

A Task containing the RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
StopScanRunRequest request = new StopScanRunRequest { Name = "", };
// Make the request
ScanRun response = await webSecurityScannerClient.StopScanRunAsync(request);

UpdateScanConfig(UpdateScanConfigRequest, CallSettings)

public virtual ScanConfig UpdateScanConfig(UpdateScanConfigRequest request, CallSettings callSettings = null)

Updates a ScanConfig. This method support partial update of a ScanConfig.

Parameters
NameDescription
requestUpdateScanConfigRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ScanConfig

The RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.Create();
// Initialize request argument(s)
UpdateScanConfigRequest request = new UpdateScanConfigRequest
{
    ScanConfig = new ScanConfig(),
    UpdateMask = new FieldMask(),
};
// Make the request
ScanConfig response = webSecurityScannerClient.UpdateScanConfig(request);

UpdateScanConfigAsync(UpdateScanConfigRequest, CallSettings)

public virtual Task<ScanConfig> UpdateScanConfigAsync(UpdateScanConfigRequest request, CallSettings callSettings = null)

Updates a ScanConfig. This method support partial update of a ScanConfig.

Parameters
NameDescription
requestUpdateScanConfigRequest

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<ScanConfig>

A Task containing the RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
UpdateScanConfigRequest request = new UpdateScanConfigRequest
{
    ScanConfig = new ScanConfig(),
    UpdateMask = new FieldMask(),
};
// Make the request
ScanConfig response = await webSecurityScannerClient.UpdateScanConfigAsync(request);

UpdateScanConfigAsync(UpdateScanConfigRequest, CancellationToken)

public virtual Task<ScanConfig> UpdateScanConfigAsync(UpdateScanConfigRequest request, CancellationToken cancellationToken)

Updates a ScanConfig. This method support partial update of a ScanConfig.

Parameters
NameDescription
requestUpdateScanConfigRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ScanConfig>

A Task containing the RPC response.

Example
// Create client
WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync();
// Initialize request argument(s)
UpdateScanConfigRequest request = new UpdateScanConfigRequest
{
    ScanConfig = new ScanConfig(),
    UpdateMask = new FieldMask(),
};
// Make the request
ScanConfig response = await webSecurityScannerClient.UpdateScanConfigAsync(request);