Class WebRiskServiceClient (1.3.0)

public abstract class WebRiskServiceClient

WebRiskService client wrapper, for convenient use.

Inheritance

Object > WebRiskServiceClient

Derived Types

Namespace

Google.Cloud.WebRisk.V1

Assembly

Google.Cloud.WebRisk.V1.dll

Remarks

Web Risk API defines an interface to detect malicious URLs on your website and in client applications.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default WebRiskService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default WebRiskService scopes are:

GrpcClient

public virtual WebRiskService.WebRiskServiceClient GrpcClient { get; }

The underlying gRPC WebRiskService client

Property Value
TypeDescription
WebRiskService.WebRiskServiceClient

Methods

ComputeThreatListDiff(ComputeThreatListDiffRequest, CallSettings)

public virtual ComputeThreatListDiffResponse ComputeThreatListDiff(ComputeThreatListDiffRequest request, CallSettings callSettings = null)

Gets the most recent threat list diffs. These diffs should be applied to a local database of hashes to keep it up-to-date. If the local database is empty or excessively out-of-date, a complete snapshot of the database will be returned. This Method only updates a single ThreatList at a time. To update multiple ThreatList databases, this method needs to be called once for each list.

Parameters
NameDescription
requestComputeThreatListDiffRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ComputeThreatListDiffResponse

The RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = WebRiskServiceClient.Create();
// Initialize request argument(s)
ComputeThreatListDiffRequest request = new ComputeThreatListDiffRequest
{
    ThreatType = ThreatType.Unspecified,
    VersionToken = ByteString.Empty,
    Constraints = new ComputeThreatListDiffRequest.Types.Constraints(),
};
// Make the request
ComputeThreatListDiffResponse response = webRiskServiceClient.ComputeThreatListDiff(request);

ComputeThreatListDiff(ThreatType, ByteString, ComputeThreatListDiffRequest.Types.Constraints, CallSettings)

public virtual ComputeThreatListDiffResponse ComputeThreatListDiff(ThreatType threatType, ByteString versionToken, ComputeThreatListDiffRequest.Types.Constraints constraints, CallSettings callSettings = null)

Gets the most recent threat list diffs. These diffs should be applied to a local database of hashes to keep it up-to-date. If the local database is empty or excessively out-of-date, a complete snapshot of the database will be returned. This Method only updates a single ThreatList at a time. To update multiple ThreatList databases, this method needs to be called once for each list.

Parameters
NameDescription
threatTypeThreatType

Required. The threat list to update. Only a single ThreatType should be specified.

versionTokenByteString

The current version token of the client for the requested list (the client version that was received from the last successful diff). If the client does not have a version token (this is the first time calling ComputeThreatListDiff), this may be left empty and a full database snapshot will be returned.

constraintsComputeThreatListDiffRequest.Types.Constraints

Required. The constraints associated with this request.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ComputeThreatListDiffResponse

The RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = WebRiskServiceClient.Create();
// Initialize request argument(s)
ThreatType threatType = ThreatType.Unspecified;
ByteString versionToken = ByteString.Empty;
ComputeThreatListDiffRequest.Types.Constraints constraints = new ComputeThreatListDiffRequest.Types.Constraints();
// Make the request
ComputeThreatListDiffResponse response = webRiskServiceClient.ComputeThreatListDiff(threatType, versionToken, constraints);

ComputeThreatListDiffAsync(ComputeThreatListDiffRequest, CallSettings)

public virtual Task<ComputeThreatListDiffResponse> ComputeThreatListDiffAsync(ComputeThreatListDiffRequest request, CallSettings callSettings = null)

Gets the most recent threat list diffs. These diffs should be applied to a local database of hashes to keep it up-to-date. If the local database is empty or excessively out-of-date, a complete snapshot of the database will be returned. This Method only updates a single ThreatList at a time. To update multiple ThreatList databases, this method needs to be called once for each list.

Parameters
NameDescription
requestComputeThreatListDiffRequest

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

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
ComputeThreatListDiffRequest request = new ComputeThreatListDiffRequest
{
    ThreatType = ThreatType.Unspecified,
    VersionToken = ByteString.Empty,
    Constraints = new ComputeThreatListDiffRequest.Types.Constraints(),
};
// Make the request
ComputeThreatListDiffResponse response = await webRiskServiceClient.ComputeThreatListDiffAsync(request);

ComputeThreatListDiffAsync(ComputeThreatListDiffRequest, CancellationToken)

public virtual Task<ComputeThreatListDiffResponse> ComputeThreatListDiffAsync(ComputeThreatListDiffRequest request, CancellationToken cancellationToken)

Gets the most recent threat list diffs. These diffs should be applied to a local database of hashes to keep it up-to-date. If the local database is empty or excessively out-of-date, a complete snapshot of the database will be returned. This Method only updates a single ThreatList at a time. To update multiple ThreatList databases, this method needs to be called once for each list.

Parameters
NameDescription
requestComputeThreatListDiffRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ComputeThreatListDiffResponse>

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
ComputeThreatListDiffRequest request = new ComputeThreatListDiffRequest
{
    ThreatType = ThreatType.Unspecified,
    VersionToken = ByteString.Empty,
    Constraints = new ComputeThreatListDiffRequest.Types.Constraints(),
};
// Make the request
ComputeThreatListDiffResponse response = await webRiskServiceClient.ComputeThreatListDiffAsync(request);

ComputeThreatListDiffAsync(ThreatType, ByteString, ComputeThreatListDiffRequest.Types.Constraints, CallSettings)

public virtual Task<ComputeThreatListDiffResponse> ComputeThreatListDiffAsync(ThreatType threatType, ByteString versionToken, ComputeThreatListDiffRequest.Types.Constraints constraints, CallSettings callSettings = null)

Gets the most recent threat list diffs. These diffs should be applied to a local database of hashes to keep it up-to-date. If the local database is empty or excessively out-of-date, a complete snapshot of the database will be returned. This Method only updates a single ThreatList at a time. To update multiple ThreatList databases, this method needs to be called once for each list.

Parameters
NameDescription
threatTypeThreatType

Required. The threat list to update. Only a single ThreatType should be specified.

versionTokenByteString

The current version token of the client for the requested list (the client version that was received from the last successful diff). If the client does not have a version token (this is the first time calling ComputeThreatListDiff), this may be left empty and a full database snapshot will be returned.

constraintsComputeThreatListDiffRequest.Types.Constraints

Required. The constraints associated with this request.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ComputeThreatListDiffResponse>

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
ThreatType threatType = ThreatType.Unspecified;
ByteString versionToken = ByteString.Empty;
ComputeThreatListDiffRequest.Types.Constraints constraints = new ComputeThreatListDiffRequest.Types.Constraints();
// Make the request
ComputeThreatListDiffResponse response = await webRiskServiceClient.ComputeThreatListDiffAsync(threatType, versionToken, constraints);

ComputeThreatListDiffAsync(ThreatType, ByteString, ComputeThreatListDiffRequest.Types.Constraints, CancellationToken)

public virtual Task<ComputeThreatListDiffResponse> ComputeThreatListDiffAsync(ThreatType threatType, ByteString versionToken, ComputeThreatListDiffRequest.Types.Constraints constraints, CancellationToken cancellationToken)

Gets the most recent threat list diffs. These diffs should be applied to a local database of hashes to keep it up-to-date. If the local database is empty or excessively out-of-date, a complete snapshot of the database will be returned. This Method only updates a single ThreatList at a time. To update multiple ThreatList databases, this method needs to be called once for each list.

Parameters
NameDescription
threatTypeThreatType

Required. The threat list to update. Only a single ThreatType should be specified.

versionTokenByteString

The current version token of the client for the requested list (the client version that was received from the last successful diff). If the client does not have a version token (this is the first time calling ComputeThreatListDiff), this may be left empty and a full database snapshot will be returned.

constraintsComputeThreatListDiffRequest.Types.Constraints

Required. The constraints associated with this request.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ComputeThreatListDiffResponse>

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
ThreatType threatType = ThreatType.Unspecified;
ByteString versionToken = ByteString.Empty;
ComputeThreatListDiffRequest.Types.Constraints constraints = new ComputeThreatListDiffRequest.Types.Constraints();
// Make the request
ComputeThreatListDiffResponse response = await webRiskServiceClient.ComputeThreatListDiffAsync(threatType, versionToken, constraints);

Create()

public static WebRiskServiceClient Create()

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

Returns
TypeDescription
WebRiskServiceClient

The created WebRiskServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<WebRiskServiceClient>

The task representing the created WebRiskServiceClient.

CreateSubmission(ProjectName, Submission, CallSettings)

public virtual Submission CreateSubmission(ProjectName parent, Submission submission, CallSettings callSettings = null)

Creates a Submission of a URI suspected of containing phishing content to be reviewed. If the result verifies the existence of malicious phishing content, the site will be added to the Google's Social Engineering lists in order to protect users that could get exposed to this threat in the future. Only projects with CREATE_SUBMISSION_USERS visibility can use this method.

Parameters
NameDescription
parentProjectName

Required. The name of the project that is making the submission. This string is in the format "projects/{project_number}".

submissionSubmission

Required. The submission that contains the content of the phishing report.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Submission

The RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = WebRiskServiceClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Submission submission = new Submission();
// Make the request
Submission response = webRiskServiceClient.CreateSubmission(parent, submission);

CreateSubmission(CreateSubmissionRequest, CallSettings)

public virtual Submission CreateSubmission(CreateSubmissionRequest request, CallSettings callSettings = null)

Creates a Submission of a URI suspected of containing phishing content to be reviewed. If the result verifies the existence of malicious phishing content, the site will be added to the Google's Social Engineering lists in order to protect users that could get exposed to this threat in the future. Only projects with CREATE_SUBMISSION_USERS visibility can use this method.

Parameters
NameDescription
requestCreateSubmissionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Submission

The RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = WebRiskServiceClient.Create();
// Initialize request argument(s)
CreateSubmissionRequest request = new CreateSubmissionRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Submission = new Submission(),
};
// Make the request
Submission response = webRiskServiceClient.CreateSubmission(request);

CreateSubmission(String, Submission, CallSettings)

public virtual Submission CreateSubmission(string parent, Submission submission, CallSettings callSettings = null)

Creates a Submission of a URI suspected of containing phishing content to be reviewed. If the result verifies the existence of malicious phishing content, the site will be added to the Google's Social Engineering lists in order to protect users that could get exposed to this threat in the future. Only projects with CREATE_SUBMISSION_USERS visibility can use this method.

Parameters
NameDescription
parentString

Required. The name of the project that is making the submission. This string is in the format "projects/{project_number}".

submissionSubmission

Required. The submission that contains the content of the phishing report.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Submission

The RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = WebRiskServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Submission submission = new Submission();
// Make the request
Submission response = webRiskServiceClient.CreateSubmission(parent, submission);

CreateSubmissionAsync(ProjectName, Submission, CallSettings)

public virtual Task<Submission> CreateSubmissionAsync(ProjectName parent, Submission submission, CallSettings callSettings = null)

Creates a Submission of a URI suspected of containing phishing content to be reviewed. If the result verifies the existence of malicious phishing content, the site will be added to the Google's Social Engineering lists in order to protect users that could get exposed to this threat in the future. Only projects with CREATE_SUBMISSION_USERS visibility can use this method.

Parameters
NameDescription
parentProjectName

Required. The name of the project that is making the submission. This string is in the format "projects/{project_number}".

submissionSubmission

Required. The submission that contains the content of the phishing report.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Submission>

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Submission submission = new Submission();
// Make the request
Submission response = await webRiskServiceClient.CreateSubmissionAsync(parent, submission);

CreateSubmissionAsync(ProjectName, Submission, CancellationToken)

public virtual Task<Submission> CreateSubmissionAsync(ProjectName parent, Submission submission, CancellationToken cancellationToken)

Creates a Submission of a URI suspected of containing phishing content to be reviewed. If the result verifies the existence of malicious phishing content, the site will be added to the Google's Social Engineering lists in order to protect users that could get exposed to this threat in the future. Only projects with CREATE_SUBMISSION_USERS visibility can use this method.

Parameters
NameDescription
parentProjectName

Required. The name of the project that is making the submission. This string is in the format "projects/{project_number}".

submissionSubmission

Required. The submission that contains the content of the phishing report.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Submission>

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Submission submission = new Submission();
// Make the request
Submission response = await webRiskServiceClient.CreateSubmissionAsync(parent, submission);

CreateSubmissionAsync(CreateSubmissionRequest, CallSettings)

public virtual Task<Submission> CreateSubmissionAsync(CreateSubmissionRequest request, CallSettings callSettings = null)

Creates a Submission of a URI suspected of containing phishing content to be reviewed. If the result verifies the existence of malicious phishing content, the site will be added to the Google's Social Engineering lists in order to protect users that could get exposed to this threat in the future. Only projects with CREATE_SUBMISSION_USERS visibility can use this method.

Parameters
NameDescription
requestCreateSubmissionRequest

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

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSubmissionRequest request = new CreateSubmissionRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Submission = new Submission(),
};
// Make the request
Submission response = await webRiskServiceClient.CreateSubmissionAsync(request);

CreateSubmissionAsync(CreateSubmissionRequest, CancellationToken)

public virtual Task<Submission> CreateSubmissionAsync(CreateSubmissionRequest request, CancellationToken cancellationToken)

Creates a Submission of a URI suspected of containing phishing content to be reviewed. If the result verifies the existence of malicious phishing content, the site will be added to the Google's Social Engineering lists in order to protect users that could get exposed to this threat in the future. Only projects with CREATE_SUBMISSION_USERS visibility can use this method.

Parameters
NameDescription
requestCreateSubmissionRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Submission>

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSubmissionRequest request = new CreateSubmissionRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Submission = new Submission(),
};
// Make the request
Submission response = await webRiskServiceClient.CreateSubmissionAsync(request);

CreateSubmissionAsync(String, Submission, CallSettings)

public virtual Task<Submission> CreateSubmissionAsync(string parent, Submission submission, CallSettings callSettings = null)

Creates a Submission of a URI suspected of containing phishing content to be reviewed. If the result verifies the existence of malicious phishing content, the site will be added to the Google's Social Engineering lists in order to protect users that could get exposed to this threat in the future. Only projects with CREATE_SUBMISSION_USERS visibility can use this method.

Parameters
NameDescription
parentString

Required. The name of the project that is making the submission. This string is in the format "projects/{project_number}".

submissionSubmission

Required. The submission that contains the content of the phishing report.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Submission>

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Submission submission = new Submission();
// Make the request
Submission response = await webRiskServiceClient.CreateSubmissionAsync(parent, submission);

CreateSubmissionAsync(String, Submission, CancellationToken)

public virtual Task<Submission> CreateSubmissionAsync(string parent, Submission submission, CancellationToken cancellationToken)

Creates a Submission of a URI suspected of containing phishing content to be reviewed. If the result verifies the existence of malicious phishing content, the site will be added to the Google's Social Engineering lists in order to protect users that could get exposed to this threat in the future. Only projects with CREATE_SUBMISSION_USERS visibility can use this method.

Parameters
NameDescription
parentString

Required. The name of the project that is making the submission. This string is in the format "projects/{project_number}".

submissionSubmission

Required. The submission that contains the content of the phishing report.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Submission>

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Submission submission = new Submission();
// Make the request
Submission response = await webRiskServiceClient.CreateSubmissionAsync(parent, submission);

SearchHashes(SearchHashesRequest, CallSettings)

public virtual SearchHashesResponse SearchHashes(SearchHashesRequest request, CallSettings callSettings = null)

Gets the full hashes that match the requested hash prefix. This is used after a hash prefix is looked up in a threatList and there is a match. The client side threatList only holds partial hashes so the client must query this method to determine if there is a full hash match of a threat.

Parameters
NameDescription
requestSearchHashesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SearchHashesResponse

The RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = WebRiskServiceClient.Create();
// Initialize request argument(s)
SearchHashesRequest request = new SearchHashesRequest
{
    HashPrefix = ByteString.Empty,
    ThreatTypes =
    {
        ThreatType.Unspecified,
    },
};
// Make the request
SearchHashesResponse response = webRiskServiceClient.SearchHashes(request);

SearchHashes(ByteString, IEnumerable<ThreatType>, CallSettings)

public virtual SearchHashesResponse SearchHashes(ByteString hashPrefix, IEnumerable<ThreatType> threatTypes, CallSettings callSettings = null)

Gets the full hashes that match the requested hash prefix. This is used after a hash prefix is looked up in a threatList and there is a match. The client side threatList only holds partial hashes so the client must query this method to determine if there is a full hash match of a threat.

Parameters
NameDescription
hashPrefixByteString

A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 hash. For JSON requests, this field is base64-encoded.

threatTypesIEnumerable<ThreatType>

Required. The ThreatLists to search in. Multiple ThreatLists may be specified.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SearchHashesResponse

The RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = WebRiskServiceClient.Create();
// Initialize request argument(s)
ByteString hashPrefix = ByteString.Empty;
IEnumerable<ThreatType> threatTypes = new ThreatType[]
{
    ThreatType.Unspecified,
};
// Make the request
SearchHashesResponse response = webRiskServiceClient.SearchHashes(hashPrefix, threatTypes);

SearchHashesAsync(SearchHashesRequest, CallSettings)

public virtual Task<SearchHashesResponse> SearchHashesAsync(SearchHashesRequest request, CallSettings callSettings = null)

Gets the full hashes that match the requested hash prefix. This is used after a hash prefix is looked up in a threatList and there is a match. The client side threatList only holds partial hashes so the client must query this method to determine if there is a full hash match of a threat.

Parameters
NameDescription
requestSearchHashesRequest

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

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
SearchHashesRequest request = new SearchHashesRequest
{
    HashPrefix = ByteString.Empty,
    ThreatTypes =
    {
        ThreatType.Unspecified,
    },
};
// Make the request
SearchHashesResponse response = await webRiskServiceClient.SearchHashesAsync(request);

SearchHashesAsync(SearchHashesRequest, CancellationToken)

public virtual Task<SearchHashesResponse> SearchHashesAsync(SearchHashesRequest request, CancellationToken cancellationToken)

Gets the full hashes that match the requested hash prefix. This is used after a hash prefix is looked up in a threatList and there is a match. The client side threatList only holds partial hashes so the client must query this method to determine if there is a full hash match of a threat.

Parameters
NameDescription
requestSearchHashesRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SearchHashesResponse>

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
SearchHashesRequest request = new SearchHashesRequest
{
    HashPrefix = ByteString.Empty,
    ThreatTypes =
    {
        ThreatType.Unspecified,
    },
};
// Make the request
SearchHashesResponse response = await webRiskServiceClient.SearchHashesAsync(request);

SearchHashesAsync(ByteString, IEnumerable<ThreatType>, CallSettings)

public virtual Task<SearchHashesResponse> SearchHashesAsync(ByteString hashPrefix, IEnumerable<ThreatType> threatTypes, CallSettings callSettings = null)

Gets the full hashes that match the requested hash prefix. This is used after a hash prefix is looked up in a threatList and there is a match. The client side threatList only holds partial hashes so the client must query this method to determine if there is a full hash match of a threat.

Parameters
NameDescription
hashPrefixByteString

A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 hash. For JSON requests, this field is base64-encoded.

threatTypesIEnumerable<ThreatType>

Required. The ThreatLists to search in. Multiple ThreatLists may be specified.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SearchHashesResponse>

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
ByteString hashPrefix = ByteString.Empty;
IEnumerable<ThreatType> threatTypes = new ThreatType[]
{
    ThreatType.Unspecified,
};
// Make the request
SearchHashesResponse response = await webRiskServiceClient.SearchHashesAsync(hashPrefix, threatTypes);

SearchHashesAsync(ByteString, IEnumerable<ThreatType>, CancellationToken)

public virtual Task<SearchHashesResponse> SearchHashesAsync(ByteString hashPrefix, IEnumerable<ThreatType> threatTypes, CancellationToken cancellationToken)

Gets the full hashes that match the requested hash prefix. This is used after a hash prefix is looked up in a threatList and there is a match. The client side threatList only holds partial hashes so the client must query this method to determine if there is a full hash match of a threat.

Parameters
NameDescription
hashPrefixByteString

A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 hash. For JSON requests, this field is base64-encoded.

threatTypesIEnumerable<ThreatType>

Required. The ThreatLists to search in. Multiple ThreatLists may be specified.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SearchHashesResponse>

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
ByteString hashPrefix = ByteString.Empty;
IEnumerable<ThreatType> threatTypes = new ThreatType[]
{
    ThreatType.Unspecified,
};
// Make the request
SearchHashesResponse response = await webRiskServiceClient.SearchHashesAsync(hashPrefix, threatTypes);

SearchUris(SearchUrisRequest, CallSettings)

public virtual SearchUrisResponse SearchUris(SearchUrisRequest request, CallSettings callSettings = null)

This method is used to check whether a URI is on a given threatList. Multiple threatLists may be searched in a single query. The response will list all requested threatLists the URI was found to match. If the URI is not found on any of the requested ThreatList an empty response will be returned.

Parameters
NameDescription
requestSearchUrisRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SearchUrisResponse

The RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = WebRiskServiceClient.Create();
// Initialize request argument(s)
SearchUrisRequest request = new SearchUrisRequest
{
    Uri = "",
    ThreatTypes =
    {
        ThreatType.Unspecified,
    },
};
// Make the request
SearchUrisResponse response = webRiskServiceClient.SearchUris(request);

SearchUris(String, IEnumerable<ThreatType>, CallSettings)

public virtual SearchUrisResponse SearchUris(string uri, IEnumerable<ThreatType> threatTypes, CallSettings callSettings = null)

This method is used to check whether a URI is on a given threatList. Multiple threatLists may be searched in a single query. The response will list all requested threatLists the URI was found to match. If the URI is not found on any of the requested ThreatList an empty response will be returned.

Parameters
NameDescription
uriString

Required. The URI to be checked for matches.

threatTypesIEnumerable<ThreatType>

Required. The ThreatLists to search in. Multiple ThreatLists may be specified.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SearchUrisResponse

The RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = WebRiskServiceClient.Create();
// Initialize request argument(s)
string uri = "";
IEnumerable<ThreatType> threatTypes = new ThreatType[]
{
    ThreatType.Unspecified,
};
// Make the request
SearchUrisResponse response = webRiskServiceClient.SearchUris(uri, threatTypes);

SearchUrisAsync(SearchUrisRequest, CallSettings)

public virtual Task<SearchUrisResponse> SearchUrisAsync(SearchUrisRequest request, CallSettings callSettings = null)

This method is used to check whether a URI is on a given threatList. Multiple threatLists may be searched in a single query. The response will list all requested threatLists the URI was found to match. If the URI is not found on any of the requested ThreatList an empty response will be returned.

Parameters
NameDescription
requestSearchUrisRequest

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

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
SearchUrisRequest request = new SearchUrisRequest
{
    Uri = "",
    ThreatTypes =
    {
        ThreatType.Unspecified,
    },
};
// Make the request
SearchUrisResponse response = await webRiskServiceClient.SearchUrisAsync(request);

SearchUrisAsync(SearchUrisRequest, CancellationToken)

public virtual Task<SearchUrisResponse> SearchUrisAsync(SearchUrisRequest request, CancellationToken cancellationToken)

This method is used to check whether a URI is on a given threatList. Multiple threatLists may be searched in a single query. The response will list all requested threatLists the URI was found to match. If the URI is not found on any of the requested ThreatList an empty response will be returned.

Parameters
NameDescription
requestSearchUrisRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SearchUrisResponse>

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
SearchUrisRequest request = new SearchUrisRequest
{
    Uri = "",
    ThreatTypes =
    {
        ThreatType.Unspecified,
    },
};
// Make the request
SearchUrisResponse response = await webRiskServiceClient.SearchUrisAsync(request);

SearchUrisAsync(String, IEnumerable<ThreatType>, CallSettings)

public virtual Task<SearchUrisResponse> SearchUrisAsync(string uri, IEnumerable<ThreatType> threatTypes, CallSettings callSettings = null)

This method is used to check whether a URI is on a given threatList. Multiple threatLists may be searched in a single query. The response will list all requested threatLists the URI was found to match. If the URI is not found on any of the requested ThreatList an empty response will be returned.

Parameters
NameDescription
uriString

Required. The URI to be checked for matches.

threatTypesIEnumerable<ThreatType>

Required. The ThreatLists to search in. Multiple ThreatLists may be specified.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SearchUrisResponse>

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
string uri = "";
IEnumerable<ThreatType> threatTypes = new ThreatType[]
{
    ThreatType.Unspecified,
};
// Make the request
SearchUrisResponse response = await webRiskServiceClient.SearchUrisAsync(uri, threatTypes);

SearchUrisAsync(String, IEnumerable<ThreatType>, CancellationToken)

public virtual Task<SearchUrisResponse> SearchUrisAsync(string uri, IEnumerable<ThreatType> threatTypes, CancellationToken cancellationToken)

This method is used to check whether a URI is on a given threatList. Multiple threatLists may be searched in a single query. The response will list all requested threatLists the URI was found to match. If the URI is not found on any of the requested ThreatList an empty response will be returned.

Parameters
NameDescription
uriString

Required. The URI to be checked for matches.

threatTypesIEnumerable<ThreatType>

Required. The ThreatLists to search in. Multiple ThreatLists may be specified.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SearchUrisResponse>

A Task containing the RPC response.

Example
// Create client
WebRiskServiceClient webRiskServiceClient = await WebRiskServiceClient.CreateAsync();
// Initialize request argument(s)
string uri = "";
IEnumerable<ThreatType> threatTypes = new ThreatType[]
{
    ThreatType.Unspecified,
};
// Make the request
SearchUrisResponse response = await webRiskServiceClient.SearchUrisAsync(uri, threatTypes);

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.