createPlaceIndex method

Future<CreatePlaceIndexResponse> createPlaceIndex({
  1. required String dataSource,
  2. required String indexName,
  3. DataSourceConfiguration? dataSourceConfiguration,
  4. String? description,
  5. PricingPlan? pricingPlan,
  6. Map<String, String>? tags,
})
Creates a place index resource in your Amazon Web Services account. Use a place index resource to geocode addresses and other text queries by using the SearchPlaceIndexForText operation, and reverse geocode coordinates by using the SearchPlaceIndexForPosition operation, and enable autosuggestions by using the SearchPlaceIndexForSuggestions operation.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter dataSource : Specifies the geospatial data provider for the new place index. Valid values include:

For additional information , see Data providers on the Amazon Location Service developer guide.

Parameter indexName : The name of the place index resource.

Requirements:

  • Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).
  • Must be a unique place index resource name.
  • No spaces allowed. For example, ExamplePlaceIndex.

Parameter dataSourceConfiguration : Specifies the data storage option requesting Places.

Parameter description : The optional description for the place index resource.

Parameter pricingPlan : No longer used. If included, the only allowed value is RequestBasedUsage.

Parameter tags : Applies one or more tags to the place index resource. A tag is a key-value pair that helps you manage, identify, search, and filter your resources.

Format: "key" : "value"

Restrictions:

  • Maximum 50 tags per resource.
  • Each tag key must be unique and must have exactly one associated value.
  • Maximum key length: 128 Unicode characters in UTF-8.
  • Maximum value length: 256 Unicode characters in UTF-8.
  • Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @
  • Cannot use "aws:" as a prefix for a key.

Implementation

Future<CreatePlaceIndexResponse> createPlaceIndex({
  required String dataSource,
  required String indexName,
  DataSourceConfiguration? dataSourceConfiguration,
  String? description,
  PricingPlan? pricingPlan,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'DataSource': dataSource,
    'IndexName': indexName,
    if (dataSourceConfiguration != null)
      'DataSourceConfiguration': dataSourceConfiguration,
    if (description != null) 'Description': description,
    if (pricingPlan != null) 'PricingPlan': pricingPlan.value,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/places/v0/indexes',
    exceptionFnMap: _exceptionFns,
  );
  return CreatePlaceIndexResponse.fromJson(response);
}