স্থান API ক্লায়েন্ট লাইব্রেরি

এই পৃষ্ঠাটি দেখায় কিভাবে Places API-এর জন্য ক্লায়েন্ট লাইব্রেরি দিয়ে শুরু করতে হয়।

ব্যাখ্যা করা ক্লায়েন্ট লাইব্রেরিতে ক্লায়েন্ট লাইব্রেরি সম্পর্কে আরও পড়ুন।

ক্লায়েন্ট লাইব্রেরি ইনস্টল করুন

জাভা

আরও তথ্যের জন্য, জাভা ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

ইনস্টলেশন নির্দেশাবলীর জন্য Java এর জন্য Google Places API ক্লায়েন্ট দেখুন।

যাও

go get cloud.google.com/go/maps

আরও তথ্যের জন্য, একটি গো ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

সম্পূর্ণ ইনস্টলেশন নির্দেশাবলীর জন্য, Go এর জন্য Google Places API ক্লায়েন্ট দেখুন।

নোডজেএস

npm install @googlemaps/places

আরও তথ্যের জন্য, একটি Node.js ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

সম্পূর্ণ ইনস্টলেশন নির্দেশাবলীর জন্য, NodeJS-এর জন্য Google Places API ক্লায়েন্ট দেখুন।

পাইথন

pip install --upgrade google-maps-places

আরও তথ্যের জন্য, পাইথন ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

সম্পূর্ণ ইনস্টলেশন নির্দেশাবলীর জন্য, Google স্থানগুলির জন্য পাইথন ক্লায়েন্ট দেখুন।

.নেট

আরও তথ্যের জন্য, একটি .নেট ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

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

Google স্থানগুলির জন্য .নেট দেখুন।

প্রমাণীকরণ সেট আপ করুন

আপনি যখন ক্লায়েন্ট লাইব্রেরি ব্যবহার করেন, আপনি প্রমাণীকরণের জন্য অ্যাপ্লিকেশন ডিফল্ট শংসাপত্র (ADC) ব্যবহার করেন। ADC সেট আপ সম্পর্কে তথ্যের জন্য, অ্যাপ্লিকেশন ডিফল্ট শংসাপত্রের জন্য প্রমাণপত্র সরবরাহ করুন দেখুন। ক্লায়েন্ট লাইব্রেরির সাথে ADC ব্যবহার সম্পর্কে তথ্যের জন্য, ক্লায়েন্ট লাইব্রেরি ব্যবহার করে প্রমাণীকরণ দেখুন।

ক্লায়েন্ট লাইব্রেরি ব্যবহার করুন

জাভা

import com.google.api.core.ApiFuture;
import com.google.maps.places.v1.GetPlaceRequest;
import com.google.maps.places.v1.Place;
import com.google.maps.places.v1.PlaceName;
import com.google.maps.places.v1.PlacesClient;

public class AsyncGetPlace {

  public static void main(String[] args) throws Exception {
    asyncGetPlace();
  }

  public static void asyncGetPlace() throws Exception {
    // 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/java/docs/setup#configure_endpoints_for_the_client_library
    try (PlacesClient placesClient = PlacesClient.create()) {
      GetPlaceRequest request =
          GetPlaceRequest.newBuilder()
              .setName(PlaceName.of("[PLACE_ID]").toString())
              .setLanguageCode("languageCode-2092349083")
              .setRegionCode("regionCode-1991004415")
              .setSessionToken("sessionToken-696552189")
              .build();
      ApiFuture<Place> future = placesClient.getPlaceCallable().futureCall(request);
      // Do something.
      Place response = future.get();
    }
  }
}

যাও

// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Code generated by protoc-gen-go_gapic. DO NOT EDIT.

package places_test

import (
	"context"

	places "cloud.google.com/go/maps/places/apiv1"
	placespb "cloud.google.com/go/maps/places/apiv1/placespb"
)

func ExampleNewClient() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func ExampleNewRESTClient() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func ExampleClient_AutocompletePlaces() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.AutocompletePlacesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#AutocompletePlacesRequest.
	}
	resp, err := c.AutocompletePlaces(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleClient_GetPhotoMedia() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.GetPhotoMediaRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#GetPhotoMediaRequest.
	}
	resp, err := c.GetPhotoMedia(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleClient_GetPlace() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.GetPlaceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#GetPlaceRequest.
	}
	resp, err := c.GetPlace(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleClient_SearchNearby() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.SearchNearbyRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#SearchNearbyRequest.
	}
	resp, err := c.SearchNearby(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleClient_SearchText() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.SearchTextRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#SearchTextRequest.
	}
	resp, err := c.SearchText(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

নোডজেএস

/**
 * 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. The resource name of a place, in the `places/{place_id}` format.
 */
// const name = 'abc123'
/**
 *  Optional. Place details will be displayed with the preferred language if
 *  available.
 *  Current list of supported languages:
 *  https://developers.google.com/maps/faq#languagesupport.
 */
// const languageCode = 'abc123'
/**
 *  Optional. The Unicode country/region code (CLDR) of the location where the
 *  request is coming from. This parameter is used to display the place
 *  details, like region-specific place name, if available. The parameter can
 *  affect results based on applicable law.
 *  For more information, see
 *  https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html.
 *  Note that 3-digit region codes are not currently supported.
 */
// const regionCode = 'abc123'
/**
 *  Optional. A string which identifies an Autocomplete session for billing
 *  purposes. Must be a URL and filename safe base64 string with at most 36
 *  ASCII characters in length. Otherwise an INVALID_ARGUMENT error is
 *  returned.
 *  The session begins when the user starts typing a query, and concludes when
 *  they select a place and a call to Place Details or Address Validation is
 *  made. Each session can have multiple queries, followed by one Place Details
 *  or Address Validation request. The credentials used for each request within
 *  a session must belong to the same Google Cloud Console project. Once a
 *  session has concluded, the token is no longer valid; your app must generate
 *  a fresh token for each session. If the `session_token` parameter is
 *  omitted, or if you reuse a session token, the session is charged as if no
 *  session token was provided (each request is billed separately).
 *  We recommend the following guidelines:
 *  * Use session tokens for all Place Autocomplete calls.
 *  * Generate a fresh token for each session. Using a version 4 UUID is
 *    recommended.
 *  * Ensure that the credentials used for all Place Autocomplete, Place
 *    Details, and Address Validation requests within a session belong to the
 *    same Cloud Console project.
 *  * Be sure to pass a unique session token for each new session. Using the
 *    same token for more than one session will result in each request being
 *    billed individually.
 */
// const sessionToken = 'abc123'

// Imports the Places library
const {PlacesClient} = require('@googlemaps/places').v1;

// Instantiates a client
const placesClient = new PlacesClient();

async function callGetPlace() {
  // Construct request
  const request = {
    name,
  };

  // Run request
  const response = await placesClient.getPlace(request);
  console.log(response);
}

callGetPlace();

পাইথন

# 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 places_v1


async def sample_get_place():
    # Create a client
    client = places_v1.PlacesAsyncClient()

    # Initialize request argument(s)
    request = places_v1.GetPlaceRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_place(request=request)

    # Handle the response
    print(response)

.নেট

// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License").
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using Google.Api.Gax.Grpc;
using Google.Cloud.ClientTesting;
using System;
using Xunit;

namespace Google.Maps.Places.V1.Snippets;

[SnippetOutputCollector]
public class PlacesClientSnippets
{
    [Fact]
    public void GettingStarted()
    {
        // Sample: GettingStarted
        PlacesClient client = PlacesClient.Create();
        CallSettings callSettings = CallSettings.FromHeader("X-Goog-FieldMask", "*");
        SearchTextRequest request = new SearchTextRequest
        {
            TextQuery = "Google, 1600 Amphitheatre Parkway, CA"
        };
        SearchTextResponse response = client.SearchText(request, callSettings);
        Console.WriteLine(response);
        // End sample
    }
}

অতিরিক্ত সম্পদ

,

এই পৃষ্ঠাটি দেখায় কিভাবে Places API-এর জন্য ক্লায়েন্ট লাইব্রেরি দিয়ে শুরু করতে হয়।

ব্যাখ্যা করা ক্লায়েন্ট লাইব্রেরিতে ক্লায়েন্ট লাইব্রেরি সম্পর্কে আরও পড়ুন।

ক্লায়েন্ট লাইব্রেরি ইনস্টল করুন

জাভা

আরও তথ্যের জন্য, জাভা ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

ইনস্টলেশন নির্দেশাবলীর জন্য Java এর জন্য Google Places API ক্লায়েন্ট দেখুন।

যাও

go get cloud.google.com/go/maps

আরও তথ্যের জন্য, একটি গো ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

সম্পূর্ণ ইনস্টলেশন নির্দেশাবলীর জন্য, Go এর জন্য Google Places API ক্লায়েন্ট দেখুন।

নোডজেএস

npm install @googlemaps/places

আরও তথ্যের জন্য, একটি Node.js ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

সম্পূর্ণ ইনস্টলেশন নির্দেশাবলীর জন্য, NodeJS-এর জন্য Google Places API ক্লায়েন্ট দেখুন।

পাইথন

pip install --upgrade google-maps-places

আরও তথ্যের জন্য, পাইথন ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

সম্পূর্ণ ইনস্টলেশন নির্দেশাবলীর জন্য, Google স্থানগুলির জন্য পাইথন ক্লায়েন্ট দেখুন।

.নেট

আরও তথ্যের জন্য, একটি .নেট ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

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

Google স্থানগুলির জন্য .নেট দেখুন।

প্রমাণীকরণ সেট আপ করুন

আপনি যখন ক্লায়েন্ট লাইব্রেরি ব্যবহার করেন, আপনি প্রমাণীকরণের জন্য অ্যাপ্লিকেশন ডিফল্ট শংসাপত্র (ADC) ব্যবহার করেন। ADC সেট আপ সম্পর্কে তথ্যের জন্য, অ্যাপ্লিকেশন ডিফল্ট শংসাপত্রের জন্য প্রমাণপত্র সরবরাহ করুন দেখুন। ক্লায়েন্ট লাইব্রেরির সাথে ADC ব্যবহার সম্পর্কে তথ্যের জন্য, ক্লায়েন্ট লাইব্রেরি ব্যবহার করে প্রমাণীকরণ দেখুন।

ক্লায়েন্ট লাইব্রেরি ব্যবহার করুন

জাভা

import com.google.api.core.ApiFuture;
import com.google.maps.places.v1.GetPlaceRequest;
import com.google.maps.places.v1.Place;
import com.google.maps.places.v1.PlaceName;
import com.google.maps.places.v1.PlacesClient;

public class AsyncGetPlace {

  public static void main(String[] args) throws Exception {
    asyncGetPlace();
  }

  public static void asyncGetPlace() throws Exception {
    // 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/java/docs/setup#configure_endpoints_for_the_client_library
    try (PlacesClient placesClient = PlacesClient.create()) {
      GetPlaceRequest request =
          GetPlaceRequest.newBuilder()
              .setName(PlaceName.of("[PLACE_ID]").toString())
              .setLanguageCode("languageCode-2092349083")
              .setRegionCode("regionCode-1991004415")
              .setSessionToken("sessionToken-696552189")
              .build();
      ApiFuture<Place> future = placesClient.getPlaceCallable().futureCall(request);
      // Do something.
      Place response = future.get();
    }
  }
}

যাও

// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Code generated by protoc-gen-go_gapic. DO NOT EDIT.

package places_test

import (
	"context"

	places "cloud.google.com/go/maps/places/apiv1"
	placespb "cloud.google.com/go/maps/places/apiv1/placespb"
)

func ExampleNewClient() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func ExampleNewRESTClient() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func ExampleClient_AutocompletePlaces() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.AutocompletePlacesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#AutocompletePlacesRequest.
	}
	resp, err := c.AutocompletePlaces(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleClient_GetPhotoMedia() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.GetPhotoMediaRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#GetPhotoMediaRequest.
	}
	resp, err := c.GetPhotoMedia(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleClient_GetPlace() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.GetPlaceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#GetPlaceRequest.
	}
	resp, err := c.GetPlace(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleClient_SearchNearby() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.SearchNearbyRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#SearchNearbyRequest.
	}
	resp, err := c.SearchNearby(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleClient_SearchText() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.SearchTextRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#SearchTextRequest.
	}
	resp, err := c.SearchText(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

নোডজেএস

/**
 * 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. The resource name of a place, in the `places/{place_id}` format.
 */
// const name = 'abc123'
/**
 *  Optional. Place details will be displayed with the preferred language if
 *  available.
 *  Current list of supported languages:
 *  https://developers.google.com/maps/faq#languagesupport.
 */
// const languageCode = 'abc123'
/**
 *  Optional. The Unicode country/region code (CLDR) of the location where the
 *  request is coming from. This parameter is used to display the place
 *  details, like region-specific place name, if available. The parameter can
 *  affect results based on applicable law.
 *  For more information, see
 *  https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html.
 *  Note that 3-digit region codes are not currently supported.
 */
// const regionCode = 'abc123'
/**
 *  Optional. A string which identifies an Autocomplete session for billing
 *  purposes. Must be a URL and filename safe base64 string with at most 36
 *  ASCII characters in length. Otherwise an INVALID_ARGUMENT error is
 *  returned.
 *  The session begins when the user starts typing a query, and concludes when
 *  they select a place and a call to Place Details or Address Validation is
 *  made. Each session can have multiple queries, followed by one Place Details
 *  or Address Validation request. The credentials used for each request within
 *  a session must belong to the same Google Cloud Console project. Once a
 *  session has concluded, the token is no longer valid; your app must generate
 *  a fresh token for each session. If the `session_token` parameter is
 *  omitted, or if you reuse a session token, the session is charged as if no
 *  session token was provided (each request is billed separately).
 *  We recommend the following guidelines:
 *  * Use session tokens for all Place Autocomplete calls.
 *  * Generate a fresh token for each session. Using a version 4 UUID is
 *    recommended.
 *  * Ensure that the credentials used for all Place Autocomplete, Place
 *    Details, and Address Validation requests within a session belong to the
 *    same Cloud Console project.
 *  * Be sure to pass a unique session token for each new session. Using the
 *    same token for more than one session will result in each request being
 *    billed individually.
 */
// const sessionToken = 'abc123'

// Imports the Places library
const {PlacesClient} = require('@googlemaps/places').v1;

// Instantiates a client
const placesClient = new PlacesClient();

async function callGetPlace() {
  // Construct request
  const request = {
    name,
  };

  // Run request
  const response = await placesClient.getPlace(request);
  console.log(response);
}

callGetPlace();

পাইথন

# 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 places_v1


async def sample_get_place():
    # Create a client
    client = places_v1.PlacesAsyncClient()

    # Initialize request argument(s)
    request = places_v1.GetPlaceRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_place(request=request)

    # Handle the response
    print(response)

.নেট

// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License").
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using Google.Api.Gax.Grpc;
using Google.Cloud.ClientTesting;
using System;
using Xunit;

namespace Google.Maps.Places.V1.Snippets;

[SnippetOutputCollector]
public class PlacesClientSnippets
{
    [Fact]
    public void GettingStarted()
    {
        // Sample: GettingStarted
        PlacesClient client = PlacesClient.Create();
        CallSettings callSettings = CallSettings.FromHeader("X-Goog-FieldMask", "*");
        SearchTextRequest request = new SearchTextRequest
        {
            TextQuery = "Google, 1600 Amphitheatre Parkway, CA"
        };
        SearchTextResponse response = client.SearchText(request, callSettings);
        Console.WriteLine(response);
        // End sample
    }
}

অতিরিক্ত সম্পদ

,

এই পৃষ্ঠাটি দেখায় কিভাবে Places API-এর জন্য ক্লায়েন্ট লাইব্রেরি দিয়ে শুরু করতে হয়।

ব্যাখ্যা করা ক্লায়েন্ট লাইব্রেরিতে ক্লায়েন্ট লাইব্রেরি সম্পর্কে আরও পড়ুন।

ক্লায়েন্ট লাইব্রেরি ইনস্টল করুন

জাভা

আরও তথ্যের জন্য, জাভা ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

ইনস্টলেশন নির্দেশাবলীর জন্য Java এর জন্য Google Places API ক্লায়েন্ট দেখুন।

যাও

go get cloud.google.com/go/maps

আরও তথ্যের জন্য, একটি গো ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

সম্পূর্ণ ইনস্টলেশন নির্দেশাবলীর জন্য, Go এর জন্য Google Places API ক্লায়েন্ট দেখুন।

নোডজেএস

npm install @googlemaps/places

আরও তথ্যের জন্য, একটি Node.js ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

সম্পূর্ণ ইনস্টলেশন নির্দেশাবলীর জন্য, NodeJS-এর জন্য Google Places API ক্লায়েন্ট দেখুন।

পাইথন

pip install --upgrade google-maps-places

আরও তথ্যের জন্য, পাইথন ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

সম্পূর্ণ ইনস্টলেশন নির্দেশাবলীর জন্য, Google স্থানগুলির জন্য পাইথন ক্লায়েন্ট দেখুন।

.নেট

আরও তথ্যের জন্য, একটি .নেট ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

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

Google স্থানগুলির জন্য .নেট দেখুন।

প্রমাণীকরণ সেট আপ করুন

আপনি যখন ক্লায়েন্ট লাইব্রেরি ব্যবহার করেন, আপনি প্রমাণীকরণের জন্য অ্যাপ্লিকেশন ডিফল্ট শংসাপত্র (ADC) ব্যবহার করেন। ADC সেট আপ সম্পর্কে তথ্যের জন্য, অ্যাপ্লিকেশন ডিফল্ট শংসাপত্রের জন্য প্রমাণপত্র সরবরাহ করুন দেখুন। ক্লায়েন্ট লাইব্রেরির সাথে ADC ব্যবহার সম্পর্কে তথ্যের জন্য, ক্লায়েন্ট লাইব্রেরি ব্যবহার করে প্রমাণীকরণ দেখুন।

ক্লায়েন্ট লাইব্রেরি ব্যবহার করুন

জাভা

import com.google.api.core.ApiFuture;
import com.google.maps.places.v1.GetPlaceRequest;
import com.google.maps.places.v1.Place;
import com.google.maps.places.v1.PlaceName;
import com.google.maps.places.v1.PlacesClient;

public class AsyncGetPlace {

  public static void main(String[] args) throws Exception {
    asyncGetPlace();
  }

  public static void asyncGetPlace() throws Exception {
    // 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/java/docs/setup#configure_endpoints_for_the_client_library
    try (PlacesClient placesClient = PlacesClient.create()) {
      GetPlaceRequest request =
          GetPlaceRequest.newBuilder()
              .setName(PlaceName.of("[PLACE_ID]").toString())
              .setLanguageCode("languageCode-2092349083")
              .setRegionCode("regionCode-1991004415")
              .setSessionToken("sessionToken-696552189")
              .build();
      ApiFuture<Place> future = placesClient.getPlaceCallable().futureCall(request);
      // Do something.
      Place response = future.get();
    }
  }
}

যাও

// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Code generated by protoc-gen-go_gapic. DO NOT EDIT.

package places_test

import (
	"context"

	places "cloud.google.com/go/maps/places/apiv1"
	placespb "cloud.google.com/go/maps/places/apiv1/placespb"
)

func ExampleNewClient() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func ExampleNewRESTClient() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func ExampleClient_AutocompletePlaces() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.AutocompletePlacesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#AutocompletePlacesRequest.
	}
	resp, err := c.AutocompletePlaces(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleClient_GetPhotoMedia() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.GetPhotoMediaRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#GetPhotoMediaRequest.
	}
	resp, err := c.GetPhotoMedia(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleClient_GetPlace() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.GetPlaceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#GetPlaceRequest.
	}
	resp, err := c.GetPlace(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleClient_SearchNearby() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.SearchNearbyRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#SearchNearbyRequest.
	}
	resp, err := c.SearchNearby(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleClient_SearchText() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.SearchTextRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#SearchTextRequest.
	}
	resp, err := c.SearchText(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

নোডজেএস

/**
 * 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. The resource name of a place, in the `places/{place_id}` format.
 */
// const name = 'abc123'
/**
 *  Optional. Place details will be displayed with the preferred language if
 *  available.
 *  Current list of supported languages:
 *  https://developers.google.com/maps/faq#languagesupport.
 */
// const languageCode = 'abc123'
/**
 *  Optional. The Unicode country/region code (CLDR) of the location where the
 *  request is coming from. This parameter is used to display the place
 *  details, like region-specific place name, if available. The parameter can
 *  affect results based on applicable law.
 *  For more information, see
 *  https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html.
 *  Note that 3-digit region codes are not currently supported.
 */
// const regionCode = 'abc123'
/**
 *  Optional. A string which identifies an Autocomplete session for billing
 *  purposes. Must be a URL and filename safe base64 string with at most 36
 *  ASCII characters in length. Otherwise an INVALID_ARGUMENT error is
 *  returned.
 *  The session begins when the user starts typing a query, and concludes when
 *  they select a place and a call to Place Details or Address Validation is
 *  made. Each session can have multiple queries, followed by one Place Details
 *  or Address Validation request. The credentials used for each request within
 *  a session must belong to the same Google Cloud Console project. Once a
 *  session has concluded, the token is no longer valid; your app must generate
 *  a fresh token for each session. If the `session_token` parameter is
 *  omitted, or if you reuse a session token, the session is charged as if no
 *  session token was provided (each request is billed separately).
 *  We recommend the following guidelines:
 *  * Use session tokens for all Place Autocomplete calls.
 *  * Generate a fresh token for each session. Using a version 4 UUID is
 *    recommended.
 *  * Ensure that the credentials used for all Place Autocomplete, Place
 *    Details, and Address Validation requests within a session belong to the
 *    same Cloud Console project.
 *  * Be sure to pass a unique session token for each new session. Using the
 *    same token for more than one session will result in each request being
 *    billed individually.
 */
// const sessionToken = 'abc123'

// Imports the Places library
const {PlacesClient} = require('@googlemaps/places').v1;

// Instantiates a client
const placesClient = new PlacesClient();

async function callGetPlace() {
  // Construct request
  const request = {
    name,
  };

  // Run request
  const response = await placesClient.getPlace(request);
  console.log(response);
}

callGetPlace();

পাইথন

# 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 places_v1


async def sample_get_place():
    # Create a client
    client = places_v1.PlacesAsyncClient()

    # Initialize request argument(s)
    request = places_v1.GetPlaceRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_place(request=request)

    # Handle the response
    print(response)

.নেট

// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License").
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using Google.Api.Gax.Grpc;
using Google.Cloud.ClientTesting;
using System;
using Xunit;

namespace Google.Maps.Places.V1.Snippets;

[SnippetOutputCollector]
public class PlacesClientSnippets
{
    [Fact]
    public void GettingStarted()
    {
        // Sample: GettingStarted
        PlacesClient client = PlacesClient.Create();
        CallSettings callSettings = CallSettings.FromHeader("X-Goog-FieldMask", "*");
        SearchTextRequest request = new SearchTextRequest
        {
            TextQuery = "Google, 1600 Amphitheatre Parkway, CA"
        };
        SearchTextResponse response = client.SearchText(request, callSettings);
        Console.WriteLine(response);
        // End sample
    }
}

অতিরিক্ত সম্পদ

,

এই পৃষ্ঠাটি দেখায় কিভাবে Places API-এর জন্য ক্লায়েন্ট লাইব্রেরি দিয়ে শুরু করতে হয়।

ব্যাখ্যা করা ক্লায়েন্ট লাইব্রেরিতে ক্লায়েন্ট লাইব্রেরি সম্পর্কে আরও পড়ুন।

ক্লায়েন্ট লাইব্রেরি ইনস্টল করুন

জাভা

আরও তথ্যের জন্য, জাভা ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

ইনস্টলেশন নির্দেশাবলীর জন্য Java এর জন্য Google Places API ক্লায়েন্ট দেখুন।

যাও

go get cloud.google.com/go/maps

আরও তথ্যের জন্য, একটি গো ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

সম্পূর্ণ ইনস্টলেশন নির্দেশাবলীর জন্য, Go এর জন্য Google Places API ক্লায়েন্ট দেখুন।

নোডজেএস

npm install @googlemaps/places

আরও তথ্যের জন্য, একটি Node.js ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

সম্পূর্ণ ইনস্টলেশন নির্দেশাবলীর জন্য, NodeJS-এর জন্য Google Places API ক্লায়েন্ট দেখুন।

পাইথন

pip install --upgrade google-maps-places

আরও তথ্যের জন্য, পাইথন ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

সম্পূর্ণ ইনস্টলেশন নির্দেশাবলীর জন্য, Google স্থানগুলির জন্য পাইথন ক্লায়েন্ট দেখুন।

.নেট

আরও তথ্যের জন্য, একটি .নেট ডেভেলপমেন্ট এনভায়রনমেন্ট সেট আপ করা দেখুন।

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

Google স্থানগুলির জন্য .নেট দেখুন।

প্রমাণীকরণ সেট আপ করুন

আপনি যখন ক্লায়েন্ট লাইব্রেরি ব্যবহার করেন, আপনি প্রমাণীকরণের জন্য অ্যাপ্লিকেশন ডিফল্ট শংসাপত্র (ADC) ব্যবহার করেন। ADC সেট আপ সম্পর্কে তথ্যের জন্য, অ্যাপ্লিকেশন ডিফল্ট শংসাপত্রের জন্য প্রমাণপত্র সরবরাহ করুন দেখুন। ক্লায়েন্ট লাইব্রেরির সাথে ADC ব্যবহার সম্পর্কে তথ্যের জন্য, ক্লায়েন্ট লাইব্রেরি ব্যবহার করে প্রমাণীকরণ দেখুন।

ক্লায়েন্ট লাইব্রেরি ব্যবহার করুন

জাভা

import com.google.api.core.ApiFuture;
import com.google.maps.places.v1.GetPlaceRequest;
import com.google.maps.places.v1.Place;
import com.google.maps.places.v1.PlaceName;
import com.google.maps.places.v1.PlacesClient;

public class AsyncGetPlace {

  public static void main(String[] args) throws Exception {
    asyncGetPlace();
  }

  public static void asyncGetPlace() throws Exception {
    // 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/java/docs/setup#configure_endpoints_for_the_client_library
    try (PlacesClient placesClient = PlacesClient.create()) {
      GetPlaceRequest request =
          GetPlaceRequest.newBuilder()
              .setName(PlaceName.of("[PLACE_ID]").toString())
              .setLanguageCode("languageCode-2092349083")
              .setRegionCode("regionCode-1991004415")
              .setSessionToken("sessionToken-696552189")
              .build();
      ApiFuture<Place> future = placesClient.getPlaceCallable().futureCall(request);
      // Do something.
      Place response = future.get();
    }
  }
}

যাও

// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Code generated by protoc-gen-go_gapic. DO NOT EDIT.

package places_test

import (
	"context"

	places "cloud.google.com/go/maps/places/apiv1"
	placespb "cloud.google.com/go/maps/places/apiv1/placespb"
)

func ExampleNewClient() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func ExampleNewRESTClient() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func ExampleClient_AutocompletePlaces() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.AutocompletePlacesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#AutocompletePlacesRequest.
	}
	resp, err := c.AutocompletePlaces(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleClient_GetPhotoMedia() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.GetPhotoMediaRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#GetPhotoMediaRequest.
	}
	resp, err := c.GetPhotoMedia(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleClient_GetPlace() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.GetPlaceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#GetPlaceRequest.
	}
	resp, err := c.GetPlace(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleClient_SearchNearby() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.SearchNearbyRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#SearchNearbyRequest.
	}
	resp, err := c.SearchNearby(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleClient_SearchText() {
	ctx := context.Background()
	// 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://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := places.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &placespb.SearchTextRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/places/apiv1/placespb#SearchTextRequest.
	}
	resp, err := c.SearchText(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

নোডজেএস

/**
 * 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. The resource name of a place, in the `places/{place_id}` format.
 */
// const name = 'abc123'
/**
 *  Optional. Place details will be displayed with the preferred language if
 *  available.
 *  Current list of supported languages:
 *  https://developers.google.com/maps/faq#languagesupport.
 */
// const languageCode = 'abc123'
/**
 *  Optional. The Unicode country/region code (CLDR) of the location where the
 *  request is coming from. This parameter is used to display the place
 *  details, like region-specific place name, if available. The parameter can
 *  affect results based on applicable law.
 *  For more information, see
 *  https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html.
 *  Note that 3-digit region codes are not currently supported.
 */
// const regionCode = 'abc123'
/**
 *  Optional. A string which identifies an Autocomplete session for billing
 *  purposes. Must be a URL and filename safe base64 string with at most 36
 *  ASCII characters in length. Otherwise an INVALID_ARGUMENT error is
 *  returned.
 *  The session begins when the user starts typing a query, and concludes when
 *  they select a place and a call to Place Details or Address Validation is
 *  made. Each session can have multiple queries, followed by one Place Details
 *  or Address Validation request. The credentials used for each request within
 *  a session must belong to the same Google Cloud Console project. Once a
 *  session has concluded, the token is no longer valid; your app must generate
 *  a fresh token for each session. If the `session_token` parameter is
 *  omitted, or if you reuse a session token, the session is charged as if no
 *  session token was provided (each request is billed separately).
 *  We recommend the following guidelines:
 *  * Use session tokens for all Place Autocomplete calls.
 *  * Generate a fresh token for each session. Using a version 4 UUID is
 *    recommended.
 *  * Ensure that the credentials used for all Place Autocomplete, Place
 *    Details, and Address Validation requests within a session belong to the
 *    same Cloud Console project.
 *  * Be sure to pass a unique session token for each new session. Using the
 *    same token for more than one session will result in each request being
 *    billed individually.
 */
// const sessionToken = 'abc123'

// Imports the Places library
const {PlacesClient} = require('@googlemaps/places').v1;

// Instantiates a client
const placesClient = new PlacesClient();

async function callGetPlace() {
  // Construct request
  const request = {
    name,
  };

  // Run request
  const response = await placesClient.getPlace(request);
  console.log(response);
}

callGetPlace();

পাইথন

# 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 places_v1


async def sample_get_place():
    # Create a client
    client = places_v1.PlacesAsyncClient()

    # Initialize request argument(s)
    request = places_v1.GetPlaceRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_place(request=request)

    # Handle the response
    print(response)

.নেট

// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License").
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using Google.Api.Gax.Grpc;
using Google.Cloud.ClientTesting;
using System;
using Xunit;

namespace Google.Maps.Places.V1.Snippets;

[SnippetOutputCollector]
public class PlacesClientSnippets
{
    [Fact]
    public void GettingStarted()
    {
        // Sample: GettingStarted
        PlacesClient client = PlacesClient.Create();
        CallSettings callSettings = CallSettings.FromHeader("X-Goog-FieldMask", "*");
        SearchTextRequest request = new SearchTextRequest
        {
            TextQuery = "Google, 1600 Amphitheatre Parkway, CA"
        };
        SearchTextResponse response = client.SearchText(request, callSettings);
        Console.WriteLine(response);
        // End sample
    }
}

অতিরিক্ত সম্পদ