Address Validation API 클라이언트 라이브러리

이 페이지에서는 Address Validation API용 클라이언트 라이브러리를 시작하는 방법을 보여줍니다.

클라이언트 라이브러리에 대한 자세한 내용은 클라이언트 라이브러리 참조 설명했습니다.

클라이언트 라이브러리 설치

C#

자세한 내용은 C# 개발 환경 설정을 참조하세요.

Install-Package Google.Maps.AddressValidation.V1 -Pre

인증 설정

클라이언트 라이브러리를 사용할 때는 애플리케이션 기본 사용자 인증 정보 (ADC) 인증할 수 있습니다 ADC 설정은 애플리케이션 기본 사용자 인증 정보에 대한 사용자 인증 정보 제공을 참조하세요. 클라이언트 라이브러리에서 ADC를 사용하는 방법은 클라이언트 라이브러리를 사용하여 인증을 참조하세요.

클라이언트 라이브러리 사용

C#

using Google.Maps.AddressValidation.V1;
using Google.Type;
using System.Threading.Tasks;

public sealed partial class GeneratedAddressValidationClientSnippets
{
    /// <summary>Snippet for ValidateAddressAsync</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public async Task ValidateAddressRequestObjectAsync()
    {
        // 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);
    }
}

추가 리소스