Class GoogleServiceOptions
- Namespace
- Visus.AddressValidation.Integration.Google.Configuration
- Assembly
- Visus.AddressValidation.Integration.Google.dll
Configuration options for the Google address validation service.
public sealed class GoogleServiceOptions : AbstractServiceOptions, IValidatableObject
- Inheritance
-
GoogleServiceOptions
- Implements
- Inherited Members
Constructors
GoogleServiceOptions()
Initializes a new instance of GoogleServiceOptions. ClientEnvironment defaults to PRODUCTION.
public GoogleServiceOptions()
Fields
SectionName
The configuration section path that binds these options from
appsettings.json or other configuration sources.
public const string SectionName = "AddressValidationSettings:Google"
Field Value
Properties
AuthenticationUri
Gets the base URI of the Google OAuth 2.0 token endpoint, derived from the current ClientEnvironment value.
public Uri AuthenticationUri { get; }
Property Value
AuthenticationUriOverride
Gets or sets a URI that overrides the default authentication endpoint derived from ClientEnvironment.
public Uri? AuthenticationUriOverride { get; set; }
Property Value
Remarks
This property is required when ClientEnvironment is SANDBOX. Validation fails if it is null in that case.
For all other environments, this property is optional. When set, it has no effect — ClientEnvironment always determines the authentication endpoint.
EndpointUri
Gets the base URI of the provider's API endpoint, derived from the current ClientEnvironment value.
public override Uri EndpointUri { get; }
Property Value
PrivateKey
Gets or sets the RSA private key associated with the service account, used to sign JWT tokens for authentication.
[Required(AllowEmptyStrings = false)]
public required string PrivateKey { get; set; }
Property Value
ProjectId
Gets or sets the Google Cloud project ID that hosts the Address Validation API.
[Required(AllowEmptyStrings = false)]
public required string ProjectId { get; set; }
Property Value
ServiceAccountEmail
Gets or sets the email address of the Google service account used to authenticate API requests.
[Required(AllowEmptyStrings = false)]
public required string ServiceAccountEmail { get; set; }
Property Value
Methods
Validate(ValidationContext)
Performs cross-property validation on the options object.
public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
Parameters
validationContextValidationContextThe context in which validation is performed.
Returns
- IEnumerable<ValidationResult>
A collection of ValidationResult instances that describe validation failures. The collection is empty when the options are valid.
Remarks
Inherits the sandbox endpoint check from Validate(ValidationContext). It also validates that AuthenticationUriOverride is not null when ClientEnvironment is SANDBOX.