Class AddressValidationClient
AddressValidation client wrapper, for convenient use.
Namespace: Google.Maps.AddressValidation.V1
Assembly: Google.Maps.AddressValidation.V1.dll
Syntax
public abstract class AddressValidationClient
Remarks
The service for validating addresses.
Properties
DefaultEndpoint
The default endpoint for the AddressValidation service, which is a host of "addressvalidation.googleapis.com" and a port of 443.
Declaration
public static string DefaultEndpoint { get; }
Property Value
Type | Description |
---|---|
string |
DefaultScopes
The default AddressValidation scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<string> |
Remarks
The default AddressValidation scopes are:
GrpcClient
The underlying gRPC AddressValidation client
Declaration
public virtual AddressValidation.AddressValidationClient GrpcClient { get; }
Property Value
Type | Description |
---|---|
AddressValidation.AddressValidationClient |
ServiceMetadata
The service metadata associated with this client type.
Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
Type | Description |
---|---|
ServiceMetadata |
Methods
Create()
Synchronously creates a AddressValidationClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AddressValidationClientBuilder.
Declaration
public static AddressValidationClient Create()
Returns
Type | Description |
---|---|
AddressValidationClient | The created AddressValidationClient. |
CreateAsync(CancellationToken)
Asynchronously creates a AddressValidationClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AddressValidationClientBuilder.
Declaration
public static Task<AddressValidationClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
Type | Description |
---|---|
Task<AddressValidationClient> | The task representing the created AddressValidationClient. |
ProvideValidationFeedback(ProvideValidationFeedbackRequest, CallSettings)
Feedback about the outcome of the sequence of validation attempts. This
should be the last call made after a sequence of validation calls for the
same address, and should be called once the transaction is concluded. This
should only be sent once for the sequence of ValidateAddress
requests
needed to validate an address fully.
Declaration
public virtual ProvideValidationFeedbackResponse ProvideValidationFeedback(ProvideValidationFeedbackRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ProvideValidationFeedbackRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
ProvideValidationFeedbackResponse | The RPC response. |
Sample code
// Create client
AddressValidationClient addressValidationClient = AddressValidationClient.Create();
// Initialize request argument(s)
ProvideValidationFeedbackRequest request = new ProvideValidationFeedbackRequest
{
Conclusion = ProvideValidationFeedbackRequest.Types.ValidationConclusion.Unspecified,
ResponseId = "",
};
// Make the request
ProvideValidationFeedbackResponse response = addressValidationClient.ProvideValidationFeedback(request);
ProvideValidationFeedbackAsync(ProvideValidationFeedbackRequest, CallSettings)
Feedback about the outcome of the sequence of validation attempts. This
should be the last call made after a sequence of validation calls for the
same address, and should be called once the transaction is concluded. This
should only be sent once for the sequence of ValidateAddress
requests
needed to validate an address fully.
Declaration
public virtual Task<ProvideValidationFeedbackResponse> ProvideValidationFeedbackAsync(ProvideValidationFeedbackRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ProvideValidationFeedbackRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<ProvideValidationFeedbackResponse> | A Task containing the RPC response. |
Sample code
// Create client
AddressValidationClient addressValidationClient = await AddressValidationClient.CreateAsync();
// Initialize request argument(s)
ProvideValidationFeedbackRequest request = new ProvideValidationFeedbackRequest
{
Conclusion = ProvideValidationFeedbackRequest.Types.ValidationConclusion.Unspecified,
ResponseId = "",
};
// Make the request
ProvideValidationFeedbackResponse response = await addressValidationClient.ProvideValidationFeedbackAsync(request);
ProvideValidationFeedbackAsync(ProvideValidationFeedbackRequest, CancellationToken)
Feedback about the outcome of the sequence of validation attempts. This
should be the last call made after a sequence of validation calls for the
same address, and should be called once the transaction is concluded. This
should only be sent once for the sequence of ValidateAddress
requests
needed to validate an address fully.
Declaration
public virtual Task<ProvideValidationFeedbackResponse> ProvideValidationFeedbackAsync(ProvideValidationFeedbackRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
ProvideValidationFeedbackRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<ProvideValidationFeedbackResponse> | A Task containing the RPC response. |
Sample code
// Create client
AddressValidationClient addressValidationClient = await AddressValidationClient.CreateAsync();
// Initialize request argument(s)
ProvideValidationFeedbackRequest request = new ProvideValidationFeedbackRequest
{
Conclusion = ProvideValidationFeedbackRequest.Types.ValidationConclusion.Unspecified,
ResponseId = "",
};
// Make the request
ProvideValidationFeedbackResponse response = await addressValidationClient.ProvideValidationFeedbackAsync(request);
ShutdownDefaultChannelsAsync()
Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
Declaration
public static Task ShutdownDefaultChannelsAsync()
Returns
Type | Description |
---|---|
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.
ValidateAddress(ValidateAddressRequest, CallSettings)
Validates an address.
Declaration
public virtual ValidateAddressResponse ValidateAddress(ValidateAddressRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ValidateAddressRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
ValidateAddressResponse | The RPC response. |
Sample code
// Create client
AddressValidationClient addressValidationClient = AddressValidationClient.Create();
// Initialize request argument(s)
ValidateAddressRequest request = new ValidateAddressRequest
{
Address = new PostalAddress(),
PreviousResponseId = "",
EnableUspsCass = false,
SessionToken = "",
};
// Make the request
ValidateAddressResponse response = addressValidationClient.ValidateAddress(request);
ValidateAddressAsync(ValidateAddressRequest, CallSettings)
Validates an address.
Declaration
public virtual Task<ValidateAddressResponse> ValidateAddressAsync(ValidateAddressRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ValidateAddressRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<ValidateAddressResponse> | A Task containing the RPC response. |
Sample code
// Create client
AddressValidationClient addressValidationClient = await AddressValidationClient.CreateAsync();
// Initialize request argument(s)
ValidateAddressRequest request = new ValidateAddressRequest
{
Address = new PostalAddress(),
PreviousResponseId = "",
EnableUspsCass = false,
SessionToken = "",
};
// Make the request
ValidateAddressResponse response = await addressValidationClient.ValidateAddressAsync(request);
ValidateAddressAsync(ValidateAddressRequest, CancellationToken)
Validates an address.
Declaration
public virtual Task<ValidateAddressResponse> ValidateAddressAsync(ValidateAddressRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
ValidateAddressRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<ValidateAddressResponse> | A Task containing the RPC response. |
Sample code
// Create client
AddressValidationClient addressValidationClient = await AddressValidationClient.CreateAsync();
// Initialize request argument(s)
ValidateAddressRequest request = new ValidateAddressRequest
{
Address = new PostalAddress(),
PreviousResponseId = "",
EnableUspsCass = false,
SessionToken = "",
};
// Make the request
ValidateAddressResponse response = await addressValidationClient.ValidateAddressAsync(request);