Maps Datasets API 클라이언트 라이브러리

이 페이지에서는 Maps Datasets API용 클라이언트 라이브러리를 시작하는 방법을 설명합니다.

클라이언트 라이브러리에 대한 자세한 내용은 클라이언트 라이브러리 설명을 참조하세요.

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

Node.js

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

npm install @googlemaps/maps-platform-datasets

Python

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

pip install --upgrade google-maps-mapsplatformdatasets

인증 설정

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

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

Node.js

/**
 * 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.
 * TODO(developer): Uncomment these variables before running the sample.
 */
/**
 *  Required. Parent project that will own the dataset.
 *  Format: projects/{$project}
 */
// const parent = 'abc123'
/**
 *  Required. The dataset version to create.
 */
// const dataset = {}

// Imports the Mapsplatformdatasets library
const {MapsPlatformDatasetsClient} = require('@googlemaps/maps-platform-datasets').v1;

// Instantiates a client
const mapsplatformdatasetsClient = new MapsPlatformDatasetsClient();

async function callCreateDataset() {
  // Construct request
  const request = {
    parent,
    dataset,
  };

  // Run request
  const response = await mapsplatformdatasetsClient.createDataset(request);
  console.log(response);
}

callCreateDataset();

Python

# 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://googleapis.dev/python/google-api-core/latest/client_options.html
from google.maps import mapsplatformdatasets_v1


def sample_create_dataset():
    # Create a client
    client = mapsplatformdatasets_v1.MapsPlatformDatasetsClient()

    # Initialize request argument(s)
    request = mapsplatformdatasets_v1.CreateDatasetRequest(
        parent="parent_value",
    )

    # Make the request
    response = client.create_dataset(request=request)

    # Handle the response
    print(response)

추가 리소스