import * as HttpClient from "effect/unstable/http/HttpClient";
import * as redacted from "effect/Redacted";
import * as S from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import * as C from "../category.js";
import { SensitiveString } from "../sensitive.js";
const svc = T.AwsApiService({
    sdkId: "Geo Places",
    serviceShapeName: "PlacesService",
});
const auth = T.AwsAuthSigv4({ name: "geo-places" });
const ver = T.ServiceVersion("2020-11-19");
const proto = T.AwsProtocolsRestJson1();
const rules = T.EndpointResolver((p, _) => {
    const { UseDualStack = false, UseFIPS = false, Endpoint, Region } = p;
    const e = (u, p = {}, h = {}) => ({
        type: "endpoint",
        endpoint: { url: u, properties: p, headers: h },
    });
    const err = (m) => ({
        type: "error",
        message: m,
    });
    if (Endpoint != null) {
        if (UseFIPS === true) {
            return err("Invalid Configuration: FIPS and custom endpoint are not supported");
        }
        if (UseDualStack === true) {
            return err("Invalid Configuration: Dualstack and custom endpoint are not supported");
        }
        return e(Endpoint);
    }
    if (Region != null) {
        {
            const PartitionResult = _.partition(Region);
            if (PartitionResult != null && PartitionResult !== false) {
                if (_.getAttr(PartitionResult, "name") === "aws" &&
                    UseFIPS === false &&
                    UseDualStack === false) {
                    return e(`https://places.geo.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
                }
                if (_.getAttr(PartitionResult, "name") === "aws" &&
                    UseFIPS === true &&
                    UseDualStack === true) {
                    return e(`https://places.geo-fips.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                }
                if (_.getAttr(PartitionResult, "name") === "aws" &&
                    UseFIPS === true &&
                    UseDualStack === false) {
                    return e(`https://places.geo-fips.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
                }
                if (_.getAttr(PartitionResult, "name") === "aws" &&
                    UseFIPS === false &&
                    UseDualStack === true) {
                    return e(`https://places.geo.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                }
                if (_.getAttr(PartitionResult, "name") === "aws-us-gov" &&
                    UseFIPS === false &&
                    UseDualStack === false) {
                    return e(`https://places.geo.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
                }
                if (_.getAttr(PartitionResult, "name") === "aws-us-gov" &&
                    UseFIPS === true &&
                    UseDualStack === true) {
                    return e(`https://places.geo-fips.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                }
                if (_.getAttr(PartitionResult, "name") === "aws-us-gov" &&
                    UseFIPS === true &&
                    UseDualStack === false) {
                    return e(`https://places.geo-fips.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
                }
                if (_.getAttr(PartitionResult, "name") === "aws-us-gov" &&
                    UseFIPS === false &&
                    UseDualStack === true) {
                    return e(`https://places.geo.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                }
                if (UseFIPS === true && UseDualStack === true) {
                    if (true === _.getAttr(PartitionResult, "supportsFIPS") &&
                        true === _.getAttr(PartitionResult, "supportsDualStack")) {
                        return e(`https://geo-places-fips.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("FIPS and DualStack are enabled, but this partition does not support one or both");
                }
                if (UseFIPS === true && UseDualStack === false) {
                    if (_.getAttr(PartitionResult, "supportsFIPS") === true) {
                        return e(`https://geo-places-fips.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
                    }
                    return err("FIPS is enabled but this partition does not support FIPS");
                }
                if (UseFIPS === false && UseDualStack === true) {
                    if (true === _.getAttr(PartitionResult, "supportsDualStack")) {
                        return e(`https://geo-places.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("DualStack is enabled but this partition does not support DualStack");
                }
                return e(`https://geo-places.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
            }
        }
    }
    return err("Invalid Configuration: Missing Region");
});
export const Position = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.Number);
export const BoundingBox = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.Number);
export const FilterCircle = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Center: Position, Radius: S.Number })).annotate({ identifier: "FilterCircle" });
export const CountryCodeList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(SensitiveString);
export const AutocompleteFilterPlaceTypeList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const AutocompleteFilter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    BoundingBox: S.optional(BoundingBox),
    Circle: S.optional(FilterCircle),
    IncludeCountries: S.optional(CountryCodeList),
    IncludePlaceTypes: S.optional(AutocompleteFilterPlaceTypeList),
})).annotate({
    identifier: "AutocompleteFilter",
});
export const AutocompleteAdditionalFeatureList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const AutocompleteRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    QueryText: SensitiveString,
    MaxResults: S.optional(S.Number),
    BiasPosition: S.optional(Position),
    Filter: S.optional(AutocompleteFilter),
    PostalCodeMode: S.optional(S.String),
    AdditionalFeatures: S.optional(AutocompleteAdditionalFeatureList),
    Language: S.optional(S.String),
    PoliticalView: S.optional(SensitiveString),
    IntendedUse: S.optional(S.String),
    Key: S.optional(SensitiveString).pipe(T.HttpQuery("key")),
}).pipe(T.all(T.Http({ method: "POST", uri: "/v2/autocomplete" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "AutocompleteRequest",
});
export const Country = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Code2: S.optional(SensitiveString),
    Code3: S.optional(SensitiveString),
    Name: S.optional(SensitiveString),
})).annotate({ identifier: "Country" });
export const Region = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Code: S.optional(SensitiveString),
    Name: S.optional(SensitiveString),
})).annotate({ identifier: "Region" });
export const SubRegion = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Code: S.optional(SensitiveString),
    Name: S.optional(SensitiveString),
})).annotate({ identifier: "SubRegion" });
export const IntersectionStreetList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const StreetComponents = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    BaseName: S.optional(SensitiveString),
    Type: S.optional(SensitiveString),
    TypePlacement: S.optional(S.String),
    TypeSeparator: S.optional(S.String),
    Prefix: S.optional(SensitiveString),
    Suffix: S.optional(SensitiveString),
    Direction: S.optional(SensitiveString),
    Language: S.optional(S.String),
})).annotate({
    identifier: "StreetComponents",
});
export const StreetComponentsList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(StreetComponents);
export const SecondaryAddressComponent = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Number: SensitiveString,
    Designator: S.optional(SensitiveString),
})).annotate({
    identifier: "SecondaryAddressComponent",
});
export const SecondaryAddressComponentList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(SecondaryAddressComponent);
export const Address = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Label: S.optional(SensitiveString),
    Country: S.optional(Country),
    Region: S.optional(Region),
    SubRegion: S.optional(SubRegion),
    Locality: S.optional(SensitiveString),
    District: S.optional(SensitiveString),
    SubDistrict: S.optional(SensitiveString),
    PostalCode: S.optional(SensitiveString),
    Block: S.optional(SensitiveString),
    SubBlock: S.optional(SensitiveString),
    Intersection: S.optional(IntersectionStreetList),
    Street: S.optional(SensitiveString),
    StreetComponents: S.optional(StreetComponentsList),
    AddressNumber: S.optional(SensitiveString),
    Building: S.optional(SensitiveString),
    SecondaryAddressComponents: S.optional(SecondaryAddressComponentList),
})).annotate({ identifier: "Address" });
export const Highlight = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    StartIndex: S.optional(S.Number),
    EndIndex: S.optional(S.Number),
    Value: S.optional(SensitiveString),
})).annotate({ identifier: "Highlight" });
export const HighlightList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Highlight);
export const CountryHighlights = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Code: S.optional(HighlightList),
    Name: S.optional(HighlightList),
})).annotate({
    identifier: "CountryHighlights",
});
export const RegionHighlights = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Code: S.optional(HighlightList),
    Name: S.optional(HighlightList),
})).annotate({
    identifier: "RegionHighlights",
});
export const SubRegionHighlights = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Code: S.optional(HighlightList),
    Name: S.optional(HighlightList),
})).annotate({
    identifier: "SubRegionHighlights",
});
export const IntersectionHighlightsList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(HighlightList);
export const AutocompleteAddressHighlights = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Label: S.optional(HighlightList),
    Country: S.optional(CountryHighlights),
    Region: S.optional(RegionHighlights),
    SubRegion: S.optional(SubRegionHighlights),
    Locality: S.optional(HighlightList),
    District: S.optional(HighlightList),
    SubDistrict: S.optional(HighlightList),
    Street: S.optional(HighlightList),
    Block: S.optional(HighlightList),
    SubBlock: S.optional(HighlightList),
    Intersection: S.optional(IntersectionHighlightsList),
    PostalCode: S.optional(HighlightList),
    AddressNumber: S.optional(HighlightList),
    Building: S.optional(HighlightList),
})).annotate({
    identifier: "AutocompleteAddressHighlights",
});
export const AutocompleteHighlights = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Title: S.optional(HighlightList),
    Address: S.optional(AutocompleteAddressHighlights),
})).annotate({
    identifier: "AutocompleteHighlights",
});
export const AutocompleteResultItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PlaceId: SensitiveString,
    PlaceType: SensitiveString,
    Title: SensitiveString,
    Address: S.optional(Address),
    Distance: S.optional(S.Number),
    Language: S.optional(S.String),
    PoliticalView: S.optional(SensitiveString),
    Highlights: S.optional(AutocompleteHighlights),
})).annotate({
    identifier: "AutocompleteResultItem",
});
export const AutocompleteResultItemList = /*@__PURE__*/ /*#__PURE__*/ S.Array(AutocompleteResultItem);
export const AutocompleteResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PricingBucket: S.String.pipe(T.HttpHeader("x-amz-geo-pricing-bucket")),
    ResultItems: S.optional(AutocompleteResultItemList),
})).annotate({
    identifier: "AutocompleteResponse",
});
export const ValidationExceptionField = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Name: S.String, Message: S.String }).pipe(S.encodeKeys({ Name: "name", Message: "message" }))).annotate({
    identifier: "ValidationExceptionField",
});
export const ValidationExceptionFieldList = /*@__PURE__*/ /*#__PURE__*/ S.Array(ValidationExceptionField);
export const GeocodeQueryComponents = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Country: S.optional(SensitiveString),
    Region: S.optional(SensitiveString),
    SubRegion: S.optional(SensitiveString),
    Locality: S.optional(SensitiveString),
    District: S.optional(SensitiveString),
    Street: S.optional(SensitiveString),
    AddressNumber: S.optional(SensitiveString),
    PostalCode: S.optional(SensitiveString),
})).annotate({
    identifier: "GeocodeQueryComponents",
});
export const GeocodeFilterPlaceTypeList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(SensitiveString);
export const GeocodeFilter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IncludeCountries: S.optional(CountryCodeList),
    IncludePlaceTypes: S.optional(GeocodeFilterPlaceTypeList),
})).annotate({ identifier: "GeocodeFilter" });
export const GeocodeAdditionalFeatureList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const GeocodeRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    QueryText: S.optional(SensitiveString),
    QueryComponents: S.optional(GeocodeQueryComponents),
    MaxResults: S.optional(S.Number),
    BiasPosition: S.optional(Position),
    Filter: S.optional(GeocodeFilter),
    AdditionalFeatures: S.optional(GeocodeAdditionalFeatureList),
    Language: S.optional(S.String),
    PoliticalView: S.optional(SensitiveString),
    IntendedUse: S.optional(S.String),
    Key: S.optional(SensitiveString).pipe(T.HttpQuery("key")),
}).pipe(T.all(T.Http({ method: "POST", uri: "/v2/geocode" }), svc, auth, proto, ver, rules))).annotate({ identifier: "GeocodeRequest" });
export const UspsZip = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ZipClassificationCode: S.optional(SensitiveString) })).annotate({ identifier: "UspsZip" });
export const UspsZipPlus4 = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ RecordTypeCode: S.optional(SensitiveString) })).annotate({ identifier: "UspsZipPlus4" });
export const PostalCodeDetails = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PostalCode: S.optional(SensitiveString),
    PostalAuthority: S.optional(SensitiveString),
    PostalCodeType: S.optional(SensitiveString),
    UspsZip: S.optional(UspsZip),
    UspsZipPlus4: S.optional(UspsZipPlus4),
})).annotate({
    identifier: "PostalCodeDetails",
});
export const PostalCodeDetailsList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(PostalCodeDetails);
export const Category = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Id: SensitiveString,
    Name: SensitiveString,
    LocalizedName: S.optional(SensitiveString),
    Primary: S.optional(S.Boolean),
})).annotate({ identifier: "Category" });
export const CategoryList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Category);
export const FoodType = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    LocalizedName: SensitiveString,
    Id: S.optional(SensitiveString),
    Primary: S.optional(S.Boolean),
})).annotate({ identifier: "FoodType" });
export const FoodTypeList = /*@__PURE__*/ /*#__PURE__*/ S.Array(FoodType);
export const AccessPoint = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Position: S.optional(Position) })).annotate({ identifier: "AccessPoint" });
export const AccessPointList = /*@__PURE__*/ /*#__PURE__*/ S.Array(AccessPoint);
export const TimeZone = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Name: SensitiveString,
    Offset: S.optional(SensitiveString),
    OffsetSeconds: S.optional(S.Number),
})).annotate({ identifier: "TimeZone" });
export const MatchScoreList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.Number);
export const SecondaryAddressComponentMatchScore = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Number: S.optional(S.Number) })).annotate({
    identifier: "SecondaryAddressComponentMatchScore",
});
export const SecondaryAddressComponentMatchScoreList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(SecondaryAddressComponentMatchScore);
export const AddressComponentMatchScores = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Country: S.optional(S.Number),
    Region: S.optional(S.Number),
    SubRegion: S.optional(S.Number),
    Locality: S.optional(S.Number),
    District: S.optional(S.Number),
    SubDistrict: S.optional(S.Number),
    PostalCode: S.optional(S.Number),
    Block: S.optional(S.Number),
    SubBlock: S.optional(S.Number),
    Intersection: S.optional(MatchScoreList),
    AddressNumber: S.optional(S.Number),
    Building: S.optional(S.Number),
    SecondaryAddressComponents: S.optional(SecondaryAddressComponentMatchScoreList),
})).annotate({
    identifier: "AddressComponentMatchScores",
});
export const ComponentMatchScores = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Title: S.optional(S.Number),
    Address: S.optional(AddressComponentMatchScores),
})).annotate({
    identifier: "ComponentMatchScores",
});
export const MatchScoreDetails = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Overall: S.optional(S.Number),
    Components: S.optional(ComponentMatchScores),
})).annotate({
    identifier: "MatchScoreDetails",
});
export const ParsedQueryComponent = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    StartIndex: S.optional(S.Number),
    EndIndex: S.optional(S.Number),
    Value: S.optional(SensitiveString),
    QueryComponent: S.optional(SensitiveString),
})).annotate({
    identifier: "ParsedQueryComponent",
});
export const ParsedQueryComponentList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ParsedQueryComponent);
export const ParsedQuerySecondaryAddressComponent = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    StartIndex: S.Number,
    EndIndex: S.Number,
    Value: SensitiveString,
    Number: SensitiveString,
    Designator: SensitiveString,
})).annotate({
    identifier: "ParsedQuerySecondaryAddressComponent",
});
export const ParsedQuerySecondaryAddressComponentList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ParsedQuerySecondaryAddressComponent);
export const GeocodeParsedQueryAddressComponents = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Country: S.optional(ParsedQueryComponentList),
    Region: S.optional(ParsedQueryComponentList),
    SubRegion: S.optional(ParsedQueryComponentList),
    Locality: S.optional(ParsedQueryComponentList),
    District: S.optional(ParsedQueryComponentList),
    SubDistrict: S.optional(ParsedQueryComponentList),
    PostalCode: S.optional(ParsedQueryComponentList),
    Block: S.optional(ParsedQueryComponentList),
    SubBlock: S.optional(ParsedQueryComponentList),
    Street: S.optional(ParsedQueryComponentList),
    AddressNumber: S.optional(ParsedQueryComponentList),
    Building: S.optional(ParsedQueryComponentList),
    SecondaryAddressComponents: S.optional(ParsedQuerySecondaryAddressComponentList),
})).annotate({
    identifier: "GeocodeParsedQueryAddressComponents",
});
export const GeocodeParsedQuery = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Title: S.optional(ParsedQueryComponentList),
    Address: S.optional(GeocodeParsedQueryAddressComponents),
})).annotate({
    identifier: "GeocodeParsedQuery",
});
export const Intersection = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PlaceId: SensitiveString,
    Title: SensitiveString,
    Address: S.optional(Address),
    Position: S.optional(Position),
    Distance: S.optional(S.Number),
    RouteDistance: S.optional(S.Number),
    MapView: S.optional(BoundingBox),
    AccessPoints: S.optional(AccessPointList),
})).annotate({ identifier: "Intersection" });
export const IntersectionList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(Intersection);
export const RelatedPlace = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PlaceId: SensitiveString,
    PlaceType: SensitiveString,
    Title: SensitiveString,
    Address: S.optional(Address),
    Position: S.optional(Position),
    AccessPoints: S.optional(AccessPointList),
})).annotate({ identifier: "RelatedPlace" });
export const RelatedPlaceList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(RelatedPlace);
export const GeocodeResultItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PlaceId: SensitiveString,
    PlaceType: SensitiveString,
    Title: SensitiveString,
    Address: S.optional(Address),
    AddressNumberCorrected: S.optional(S.Boolean),
    PostalCodeDetails: S.optional(PostalCodeDetailsList),
    Position: S.optional(Position),
    Distance: S.optional(S.Number),
    MapView: S.optional(BoundingBox),
    Categories: S.optional(CategoryList),
    FoodTypes: S.optional(FoodTypeList),
    AccessPoints: S.optional(AccessPointList),
    TimeZone: S.optional(TimeZone),
    PoliticalView: S.optional(SensitiveString),
    MatchScores: S.optional(MatchScoreDetails),
    ParsedQuery: S.optional(GeocodeParsedQuery),
    Intersections: S.optional(IntersectionList),
    MainAddress: S.optional(RelatedPlace),
    SecondaryAddresses: S.optional(RelatedPlaceList),
})).annotate({
    identifier: "GeocodeResultItem",
});
export const GeocodeResultItemList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(GeocodeResultItem);
export const GeocodeResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PricingBucket: S.String.pipe(T.HttpHeader("x-amz-geo-pricing-bucket")),
    ResultItems: S.optional(GeocodeResultItemList),
})).annotate({
    identifier: "GeocodeResponse",
});
export const GetPlaceAdditionalFeatureList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const GetPlaceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PlaceId: SensitiveString.pipe(T.HttpLabel("PlaceId")),
    AdditionalFeatures: S.optional(GetPlaceAdditionalFeatureList).pipe(T.HttpQuery("additional-features")),
    Language: S.optional(S.String).pipe(T.HttpQuery("language")),
    PoliticalView: S.optional(SensitiveString).pipe(T.HttpQuery("political-view")),
    IntendedUse: S.optional(S.String).pipe(T.HttpQuery("intended-use")),
    Key: S.optional(SensitiveString).pipe(T.HttpQuery("key")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/v2/place/{PlaceId}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetPlaceRequest",
});
export const BusinessChain = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Name: S.optional(SensitiveString),
    Id: S.optional(SensitiveString),
})).annotate({ identifier: "BusinessChain" });
export const BusinessChainList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(BusinessChain);
export const ContactDetails = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Label: S.optional(SensitiveString),
    Value: S.optional(SensitiveString),
    Categories: S.optional(CategoryList),
})).annotate({ identifier: "ContactDetails" });
export const ContactDetailsList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ContactDetails);
export const Contacts = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Phones: S.optional(ContactDetailsList),
    Faxes: S.optional(ContactDetailsList),
    Websites: S.optional(ContactDetailsList),
    Emails: S.optional(ContactDetailsList),
})).annotate({ identifier: "Contacts" });
export const OpeningHoursDisplayList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(SensitiveString);
export const OpeningHoursComponents = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    OpenTime: S.optional(SensitiveString),
    OpenDuration: S.optional(SensitiveString),
    Recurrence: S.optional(SensitiveString),
})).annotate({
    identifier: "OpeningHoursComponents",
});
export const OpeningHoursComponentsList = /*@__PURE__*/ /*#__PURE__*/ S.Array(OpeningHoursComponents);
export const OpeningHours = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Display: S.optional(OpeningHoursDisplayList),
    OpenNow: S.optional(S.Boolean),
    Components: S.optional(OpeningHoursComponentsList),
    Categories: S.optional(CategoryList),
})).annotate({ identifier: "OpeningHours" });
export const OpeningHoursList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(OpeningHours);
export const AccessRestriction = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Restricted: S.optional(S.Boolean),
    Categories: S.optional(CategoryList),
})).annotate({
    identifier: "AccessRestriction",
});
export const AccessRestrictionList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(AccessRestriction);
export const PhonemeTranscription = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Value: S.optional(SensitiveString),
    Language: S.optional(S.String),
    Preferred: S.optional(S.Boolean),
})).annotate({
    identifier: "PhonemeTranscription",
});
export const PhonemeTranscriptionList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(PhonemeTranscription);
export const AddressComponentPhonemes = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Country: S.optional(PhonemeTranscriptionList),
    Region: S.optional(PhonemeTranscriptionList),
    SubRegion: S.optional(PhonemeTranscriptionList),
    Locality: S.optional(PhonemeTranscriptionList),
    District: S.optional(PhonemeTranscriptionList),
    SubDistrict: S.optional(PhonemeTranscriptionList),
    Block: S.optional(PhonemeTranscriptionList),
    SubBlock: S.optional(PhonemeTranscriptionList),
    Street: S.optional(PhonemeTranscriptionList),
})).annotate({
    identifier: "AddressComponentPhonemes",
});
export const PhonemeDetails = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Title: S.optional(PhonemeTranscriptionList),
    Address: S.optional(AddressComponentPhonemes),
})).annotate({ identifier: "PhonemeDetails" });
export const GetPlaceResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PlaceId: SensitiveString,
    PlaceType: SensitiveString,
    Title: SensitiveString,
    PricingBucket: S.String.pipe(T.HttpHeader("x-amz-geo-pricing-bucket")),
    Address: S.optional(Address),
    AddressNumberCorrected: S.optional(S.Boolean),
    PostalCodeDetails: S.optional(PostalCodeDetailsList),
    Position: S.optional(Position),
    MapView: S.optional(BoundingBox),
    Categories: S.optional(CategoryList),
    FoodTypes: S.optional(FoodTypeList),
    BusinessChains: S.optional(BusinessChainList),
    Contacts: S.optional(Contacts),
    OpeningHours: S.optional(OpeningHoursList),
    AccessPoints: S.optional(AccessPointList),
    AccessRestrictions: S.optional(AccessRestrictionList),
    TimeZone: S.optional(TimeZone),
    PoliticalView: S.optional(SensitiveString),
    Phonemes: S.optional(PhonemeDetails),
    MainAddress: S.optional(RelatedPlace),
    SecondaryAddresses: S.optional(RelatedPlaceList),
})).annotate({
    identifier: "GetPlaceResponse",
});
export const ReverseGeocodeFilterPlaceTypeList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const ReverseGeocodeFilter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IncludePlaceTypes: S.optional(ReverseGeocodeFilterPlaceTypeList),
})).annotate({
    identifier: "ReverseGeocodeFilter",
});
export const ReverseGeocodeAdditionalFeatureList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const ReverseGeocodeRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    QueryPosition: Position,
    QueryRadius: S.optional(S.Number),
    MaxResults: S.optional(S.Number),
    Filter: S.optional(ReverseGeocodeFilter),
    AdditionalFeatures: S.optional(ReverseGeocodeAdditionalFeatureList),
    Language: S.optional(S.String),
    PoliticalView: S.optional(SensitiveString),
    IntendedUse: S.optional(S.String),
    Key: S.optional(SensitiveString).pipe(T.HttpQuery("key")),
    Heading: S.optional(S.Number),
}).pipe(T.all(T.Http({ method: "POST", uri: "/v2/reverse-geocode" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ReverseGeocodeRequest",
});
export const ReverseGeocodeResultItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PlaceId: SensitiveString,
    PlaceType: SensitiveString,
    Title: SensitiveString,
    Address: S.optional(Address),
    AddressNumberCorrected: S.optional(S.Boolean),
    PostalCodeDetails: S.optional(PostalCodeDetailsList),
    Position: S.optional(Position),
    Distance: S.optional(S.Number),
    MapView: S.optional(BoundingBox),
    Categories: S.optional(CategoryList),
    FoodTypes: S.optional(FoodTypeList),
    AccessPoints: S.optional(AccessPointList),
    TimeZone: S.optional(TimeZone),
    PoliticalView: S.optional(SensitiveString),
    Intersections: S.optional(IntersectionList),
})).annotate({
    identifier: "ReverseGeocodeResultItem",
});
export const ReverseGeocodeResultItemList = /*@__PURE__*/ /*#__PURE__*/ S.Array(ReverseGeocodeResultItem);
export const ReverseGeocodeResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PricingBucket: S.String.pipe(T.HttpHeader("x-amz-geo-pricing-bucket")),
    ResultItems: S.optional(ReverseGeocodeResultItemList),
})).annotate({
    identifier: "ReverseGeocodeResponse",
});
export const FilterCategoryList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(SensitiveString);
export const FilterBusinessChainList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(SensitiveString);
export const FilterFoodTypeList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(SensitiveString);
export const SearchNearbyFilter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    BoundingBox: S.optional(BoundingBox),
    IncludeCountries: S.optional(CountryCodeList),
    IncludeCategories: S.optional(FilterCategoryList),
    ExcludeCategories: S.optional(FilterCategoryList),
    IncludeBusinessChains: S.optional(FilterBusinessChainList),
    ExcludeBusinessChains: S.optional(FilterBusinessChainList),
    IncludeFoodTypes: S.optional(FilterFoodTypeList),
    ExcludeFoodTypes: S.optional(FilterFoodTypeList),
})).annotate({
    identifier: "SearchNearbyFilter",
});
export const SearchNearbyAdditionalFeatureList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const SearchNearbyRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    QueryPosition: Position,
    QueryRadius: S.optional(S.Number),
    MaxResults: S.optional(S.Number),
    Filter: S.optional(SearchNearbyFilter),
    AdditionalFeatures: S.optional(SearchNearbyAdditionalFeatureList),
    Language: S.optional(S.String),
    PoliticalView: S.optional(SensitiveString),
    IntendedUse: S.optional(S.String),
    NextToken: S.optional(S.String),
    Key: S.optional(SensitiveString).pipe(T.HttpQuery("key")),
}).pipe(T.all(T.Http({ method: "POST", uri: "/v2/search-nearby" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "SearchNearbyRequest",
});
export const SearchNearbyResultItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PlaceId: SensitiveString,
    PlaceType: SensitiveString,
    Title: SensitiveString,
    Address: S.optional(Address),
    AddressNumberCorrected: S.optional(S.Boolean),
    Position: S.optional(Position),
    Distance: S.optional(S.Number),
    MapView: S.optional(BoundingBox),
    Categories: S.optional(CategoryList),
    FoodTypes: S.optional(FoodTypeList),
    BusinessChains: S.optional(BusinessChainList),
    Contacts: S.optional(Contacts),
    OpeningHours: S.optional(OpeningHoursList),
    AccessPoints: S.optional(AccessPointList),
    AccessRestrictions: S.optional(AccessRestrictionList),
    TimeZone: S.optional(TimeZone),
    PoliticalView: S.optional(SensitiveString),
    Phonemes: S.optional(PhonemeDetails),
})).annotate({
    identifier: "SearchNearbyResultItem",
});
export const SearchNearbyResultItemList = /*@__PURE__*/ /*#__PURE__*/ S.Array(SearchNearbyResultItem);
export const SearchNearbyResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PricingBucket: S.String.pipe(T.HttpHeader("x-amz-geo-pricing-bucket")),
    ResultItems: S.optional(SearchNearbyResultItemList),
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "SearchNearbyResponse",
});
export const SearchTextFilter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    BoundingBox: S.optional(BoundingBox),
    Circle: S.optional(FilterCircle),
    IncludeCountries: S.optional(CountryCodeList),
})).annotate({
    identifier: "SearchTextFilter",
});
export const SearchTextAdditionalFeatureList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const SearchTextRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    QueryText: S.optional(SensitiveString),
    QueryId: S.optional(SensitiveString),
    MaxResults: S.optional(S.Number),
    BiasPosition: S.optional(Position),
    Filter: S.optional(SearchTextFilter),
    AdditionalFeatures: S.optional(SearchTextAdditionalFeatureList),
    Language: S.optional(S.String),
    PoliticalView: S.optional(SensitiveString),
    IntendedUse: S.optional(S.String),
    NextToken: S.optional(S.String),
    Key: S.optional(SensitiveString).pipe(T.HttpQuery("key")),
}).pipe(T.all(T.Http({ method: "POST", uri: "/v2/search-text" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "SearchTextRequest",
});
export const SearchTextResultItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PlaceId: SensitiveString,
    PlaceType: SensitiveString,
    Title: SensitiveString,
    Address: S.optional(Address),
    AddressNumberCorrected: S.optional(S.Boolean),
    Position: S.optional(Position),
    Distance: S.optional(S.Number),
    MapView: S.optional(BoundingBox),
    Categories: S.optional(CategoryList),
    FoodTypes: S.optional(FoodTypeList),
    BusinessChains: S.optional(BusinessChainList),
    Contacts: S.optional(Contacts),
    OpeningHours: S.optional(OpeningHoursList),
    AccessPoints: S.optional(AccessPointList),
    AccessRestrictions: S.optional(AccessRestrictionList),
    TimeZone: S.optional(TimeZone),
    PoliticalView: S.optional(SensitiveString),
    Phonemes: S.optional(PhonemeDetails),
})).annotate({
    identifier: "SearchTextResultItem",
});
export const SearchTextResultItemList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(SearchTextResultItem);
export const SearchTextResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PricingBucket: S.String.pipe(T.HttpHeader("x-amz-geo-pricing-bucket")),
    ResultItems: S.optional(SearchTextResultItemList),
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "SearchTextResponse",
});
export const SuggestFilter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    BoundingBox: S.optional(BoundingBox),
    Circle: S.optional(FilterCircle),
    IncludeCountries: S.optional(CountryCodeList),
})).annotate({ identifier: "SuggestFilter" });
export const SuggestAdditionalFeatureList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const SuggestRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    QueryText: SensitiveString,
    MaxResults: S.optional(S.Number),
    MaxQueryRefinements: S.optional(S.Number),
    BiasPosition: S.optional(Position),
    Filter: S.optional(SuggestFilter),
    AdditionalFeatures: S.optional(SuggestAdditionalFeatureList),
    Language: S.optional(S.String),
    PoliticalView: S.optional(SensitiveString),
    IntendedUse: S.optional(S.String),
    Key: S.optional(SensitiveString).pipe(T.HttpQuery("key")),
}).pipe(T.all(T.Http({ method: "POST", uri: "/v2/suggest" }), svc, auth, proto, ver, rules))).annotate({ identifier: "SuggestRequest" });
export const SuggestPlaceResult = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PlaceId: S.optional(SensitiveString),
    PlaceType: S.optional(SensitiveString),
    Address: S.optional(Address),
    Position: S.optional(Position),
    Distance: S.optional(S.Number),
    MapView: S.optional(BoundingBox),
    Categories: S.optional(CategoryList),
    FoodTypes: S.optional(FoodTypeList),
    BusinessChains: S.optional(BusinessChainList),
    AccessPoints: S.optional(AccessPointList),
    AccessRestrictions: S.optional(AccessRestrictionList),
    TimeZone: S.optional(TimeZone),
    PoliticalView: S.optional(SensitiveString),
    Phonemes: S.optional(PhonemeDetails),
})).annotate({
    identifier: "SuggestPlaceResult",
});
export const SuggestQueryResult = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    QueryId: S.optional(SensitiveString),
    QueryType: S.optional(S.String),
})).annotate({
    identifier: "SuggestQueryResult",
});
export const SuggestAddressHighlights = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Label: S.optional(HighlightList) })).annotate({
    identifier: "SuggestAddressHighlights",
});
export const SuggestHighlights = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Title: S.optional(HighlightList),
    Address: S.optional(SuggestAddressHighlights),
})).annotate({
    identifier: "SuggestHighlights",
});
export const SuggestResultItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Title: SensitiveString,
    SuggestResultItemType: S.String,
    Place: S.optional(SuggestPlaceResult),
    Query: S.optional(SuggestQueryResult),
    Highlights: S.optional(SuggestHighlights),
})).annotate({
    identifier: "SuggestResultItem",
});
export const SuggestResultItemList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(SuggestResultItem);
export const QueryRefinement = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    RefinedTerm: SensitiveString,
    OriginalTerm: SensitiveString,
    StartIndex: S.Number,
    EndIndex: S.Number,
})).annotate({
    identifier: "QueryRefinement",
});
export const QueryRefinementList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(QueryRefinement);
export const SuggestResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PricingBucket: S.String.pipe(T.HttpHeader("x-amz-geo-pricing-bucket")),
    ResultItems: S.optional(SuggestResultItemList),
    QueryRefinements: S.optional(QueryRefinementList),
})).annotate({
    identifier: "SuggestResponse",
});
//# Errors
export class AccessDeniedException extends S.TaggedErrorClass()("AccessDeniedException", { Message: S.String }).pipe(C.withAuthError) {
}
export class InternalServerException extends S.TaggedErrorClass()("InternalServerException", { Message: S.String }, T.Retryable()).pipe(C.withServerError, C.withRetryableError) {
}
export class ThrottlingException extends S.TaggedErrorClass()("ThrottlingException", { Message: S.String }, T.Retryable()).pipe(C.withThrottlingError, C.withRetryableError) {
}
export class ValidationException extends S.TaggedErrorClass()("ValidationException", {
    Message: S.String,
    Reason: S.String,
    FieldList: ValidationExceptionFieldList,
}).pipe(C.withBadRequestError) {
}
/**
 * `Autocomplete` completes potential places and addresses as the user types, based on the partial input. The API enhances the efficiency and accuracy of address by completing query based on a few entered keystrokes. It helps you by completing partial queries with valid address completion. Also, the API supports the filtering of results based on geographic location, country, or specific place types, and can be tailored using optional parameters like language and political views.
 *
 * For more information, see Autocomplete in the *Amazon Location Service Developer Guide*.
 */
export const autocomplete = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: AutocompleteRequest,
    output: AutocompleteResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * `Geocode` converts a textual address or place into geographic coordinates. You can obtain geographic coordinates, address component, and other related information. It supports flexible queries, including free-form text or structured queries with components like street names, postal codes, and regions. The Geocode API can also provide additional features such as time zone information and the inclusion of political views.
 *
 * For more information, see Geocode in the *Amazon Location Service Developer Guide*.
 */
export const geocode = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GeocodeRequest,
    output: GeocodeResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * `GetPlace` finds a place by its unique ID. A `PlaceId` is returned by other place operations.
 *
 * For more information, see GetPlace in the *Amazon Location Service Developer Guide*.
 */
export const getPlace = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetPlaceRequest,
    output: GetPlaceResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * `ReverseGeocode` converts geographic coordinates into a human-readable address or place. You can obtain address component, and other related information such as place type, category, street information. The Reverse Geocode API supports filtering to on place type so that you can refine result based on your need. Also, The Reverse Geocode API can also provide additional features such as time zone information and the inclusion of political views.
 *
 * For more information, see Reverse Geocode in the *Amazon Location Service Developer Guide*.
 */
export const reverseGeocode = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ReverseGeocodeRequest,
    output: ReverseGeocodeResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * `SearchNearby` queries for points of interest within a radius from a central coordinates, returning place results with optional filters such as categories, business chains, food types and more. The API returns details such as a place name, address, phone, category, food type, contact, opening hours. Also, the API can return phonemes, time zones and more based on requested parameters.
 *
 * For more information, see Search Nearby in the *Amazon Location Service Developer Guide*.
 */
export const searchNearby = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: SearchNearbyRequest,
    output: SearchNearbyResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * `SearchText` searches for geocode and place information. You can then complete a follow-up query suggested from the `Suggest` API via a query id.
 *
 * For more information, see Search Text in the *Amazon Location Service Developer Guide*.
 */
export const searchText = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: SearchTextRequest,
    output: SearchTextResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * `Suggest` provides intelligent predictions or recommendations based on the user's input or context, such as relevant places, points of interest, query terms or search category. It is designed to help users find places or point of interests candidates or identify a follow on query based on incomplete or misspelled queries. It returns a list of possible matches or refinements that can be used to formulate a more accurate query. Users can select the most appropriate suggestion and use it for further searching. The API provides options for filtering results by location and other attributes, and allows for additional features like phonemes and timezones. The response includes refined query terms and detailed place information.
 *
 * For more information, see Suggest in the *Amazon Location Service Developer Guide*.
 */
export const suggest = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: SuggestRequest,
    output: SuggestResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
//# sourceMappingURL=geo-places.js.map