Class GoogleServiceOptions
- Namespace
- Visus.AddressValidation.Integration.Google.Configuration
- Assembly
- Visus.AddressValidation.Integration.Google.dll
Configuration options for the Google Address Validation API service account.
public sealed class GoogleServiceOptions : AbstractServiceOptions, IValidatableObject
- Inheritance
-
GoogleServiceOptions
- Implements
- Inherited Members
Constructors
GoogleServiceOptions()
Initializes a new instance of GoogleServiceOptions with ClientEnvironment defaulting to PRODUCTION.
public GoogleServiceOptions()
Fields
SectionName
The configuration section path used to bind 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 will fail if it is null in that case.
For all other environments this property is optional and, when set, has no effect — the authentication endpoint is always resolved from ClientEnvironment.
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 describing any validation failures, or an empty collection if the options are valid.
Remarks
Inherits the sandbox endpoint override check from Validate(ValidationContext) and additionally validates that AuthenticationUriOverride is not null when ClientEnvironment is SANDBOX.