From c80d8c39da7c16c3c79e24b1ec8539a596812aa4 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:17:32 +0800 Subject: [PATCH 1/7] refresh maps-render-rest sdk --- .../{src => }/generated/clientDefinitions.ts | 66 +++++------- .../{src => }/generated/index.ts | 0 .../{src => }/generated/isUnexpected.ts | 101 ++++++++++-------- sdk/maps/maps-render-rest/generated/logger.ts | 5 + .../generated/mapsRenderClient.ts | 67 ++++++++++++ .../{src => }/generated/outputModels.ts | 32 +++--- .../{src => }/generated/parameters.ts | 32 +++--- .../{src => }/generated/responses.ts | 74 +++++-------- .../review/maps-render.api.md | 37 ++++--- .../samples-dev/getCopyrightCaption.ts | 2 +- .../samples-dev/getCopyrightForTile.ts | 2 +- .../samples-dev/getCopyrightForWorld.ts | 2 +- .../getCopyrightFromBoundingBox.ts | 2 +- .../samples-dev/getMapAttribution.ts | 2 +- .../samples-dev/getMapTileset.ts | 2 +- .../src/generated/mapsRenderClient.ts | 40 ------- sdk/maps/maps-render-rest/src/index.ts | 2 +- sdk/maps/maps-render-rest/src/mapsRender.ts | 4 +- sdk/maps/maps-render-rest/swagger/README.md | 2 + sdk/maps/maps-render-rest/tsconfig.json | 17 ++- 20 files changed, 260 insertions(+), 231 deletions(-) rename sdk/maps/maps-render-rest/{src => }/generated/clientDefinitions.ts (62%) rename sdk/maps/maps-render-rest/{src => }/generated/index.ts (100%) rename sdk/maps/maps-render-rest/{src => }/generated/isUnexpected.ts (67%) create mode 100644 sdk/maps/maps-render-rest/generated/logger.ts create mode 100644 sdk/maps/maps-render-rest/generated/mapsRenderClient.ts rename sdk/maps/maps-render-rest/{src => }/generated/outputModels.ts (86%) rename sdk/maps/maps-render-rest/{src => }/generated/parameters.ts (94%) rename sdk/maps/maps-render-rest/{src => }/generated/responses.ts (54%) delete mode 100644 sdk/maps/maps-render-rest/src/generated/mapsRenderClient.ts diff --git a/sdk/maps/maps-render-rest/src/generated/clientDefinitions.ts b/sdk/maps/maps-render-rest/generated/clientDefinitions.ts similarity index 62% rename from sdk/maps/maps-render-rest/src/generated/clientDefinitions.ts rename to sdk/maps/maps-render-rest/generated/clientDefinitions.ts index 0dfb86f3af1b..7d8fb95a9f1e 100644 --- a/sdk/maps/maps-render-rest/src/generated/clientDefinitions.ts +++ b/sdk/maps/maps-render-rest/generated/clientDefinitions.ts @@ -10,7 +10,7 @@ import { RenderGetMapStaticImageParameters, RenderGetCopyrightFromBoundingBoxParameters, RenderGetCopyrightForTileParameters, - RenderGetCopyrightForWorldParameters + RenderGetCopyrightForWorldParameters, } from "./parameters"; import { RenderGetMapTile200Response, @@ -30,18 +30,18 @@ import { RenderGetCopyrightForTile200Response, RenderGetCopyrightForTileDefaultResponse, RenderGetCopyrightForWorld200Response, - RenderGetCopyrightForWorldDefaultResponse + RenderGetCopyrightForWorldDefaultResponse, } from "./responses"; import { Client, StreamableMethod } from "@azure-rest/core-client"; export interface GetMapTile { /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * ** * - * The Get Map Tiles API allows users to request map tiles in vector or raster formats typically to be integrated into a map control or SDK. Some example tiles that can be requested are Azure Maps road tiles, real-time Weather Radar tiles or the map tiles created using [Azure Maps Creator](https://aka.ms/amcreator). By default, Azure Maps uses vector tiles for its web map control (Web SDK) and Android SDK. + * The `Get Map Tiles` API is an HTTP `GET` request that allows users to request map tiles in vector or raster formats, typically to be integrated into a map control or SDK. Some example tiles that can be requested are Azure Maps road tiles, real-time Weather Radar tiles or the map tiles created using [Azure Maps Creator](https://aka.ms/amcreator). By default, Azure Maps uses vector tiles for its web map control ([Web SDK](/azure/azure-maps/about-azure-maps#web-sdk)) and [Android SDK](/azure/azure-maps/about-azure-maps#android-sdk). */ get( - options: RenderGetMapTileParameters + options: RenderGetMapTileParameters, ): StreamableMethod< RenderGetMapTile200Response | RenderGetMapTileDefaultResponse >; @@ -49,12 +49,12 @@ export interface GetMapTile { export interface GetMapTileset { /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * ** * - * The Get Map Tileset API allows users to request metadata for a tileset. + * The `Get Map Tileset` API is an HTTP `GET` request allows users to request [metadata](#maptileset) for a tileset. */ get( - options: RenderGetMapTilesetParameters + options: RenderGetMapTilesetParameters, ): StreamableMethod< RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse >; @@ -62,12 +62,11 @@ export interface GetMapTileset { export interface GetMapAttribution { /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * The Get Map Attribution API allows users to request map copyright attribution information for a section of a tileset. + * The `Get Map Attribution` API is an HTTP `GET` request that returns map copyright attribution information for a section of a tileset as defined by the four bounding box coordinates and zoom level. */ get( - options: RenderGetMapAttributionParameters + options: RenderGetMapAttributionParameters, ): StreamableMethod< RenderGetMapAttribution200Response | RenderGetMapAttributionDefaultResponse >; @@ -75,12 +74,11 @@ export interface GetMapAttribution { export interface GetMapStateTile { /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * Fetches state tiles in vector format typically to be integrated into indoor maps module of map control or SDK. The map control will call this API after user turns on dynamic styling (see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid)) + * The `Get Map State Tile` API is an HTTP `GET` request that fetches state tiles in vector format, typically to be integrated into the indoor maps module of a map control or SDK. The map control calls this API after dynamic styling is turned on. For more information, see [Zoom Levels and Tile Grid](/azure/azure-maps/zoom-levels-and-tile-grid). */ get( - options: RenderGetMapStateTileParameters + options: RenderGetMapStateTileParameters, ): StreamableMethod< RenderGetMapStateTile200Response | RenderGetMapStateTileDefaultResponse >; @@ -88,17 +86,13 @@ export interface GetMapStateTile { export interface GetCopyrightCaption { /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * Copyrights API is designed to serve copyright information for Render Tile - * service. In addition to basic copyright for the whole map, API is serving - * specific groups of copyrights for some countries/regions. + * The `Get Copyright Caption` API is an HTTP `GET` request designed to serve copyright information to be use in conjunction with tiles requested from the Render service. In addition to a basic copyright for the whole map, it can serve specific groups of copyrights for some countries/regions. * - * As an alternative to copyrights for map request, one can receive captions - * for displaying the map provider information on the map. + * As an alternative to copyrights for map request, one can receive captions for displaying the map provider information on the map. */ get( - options?: RenderGetCopyrightCaptionParameters + options?: RenderGetCopyrightCaptionParameters, ): StreamableMethod< | RenderGetCopyrightCaption200Response | RenderGetCopyrightCaptionDefaultResponse @@ -107,9 +101,8 @@ export interface GetCopyrightCaption { export interface GetMapStaticImage { /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * The static image service renders a user-defined, rectangular image containing a map section using a zoom level from 0 to 20. The supported resolution range for the map image is from 1x1 to 8192x8192. If you are deciding when to use the static image service over the map tile service, you may want to consider how you would like to interact with the rendered map. If the map contents will be relatively unchanging, a static map is a good choice. If you want to support a lot of zooming, panning and changing of the map content, the map tile service would be a better choice. + * The supported resolution range for the map image is from 1x1 to 8192x8192. If you are deciding when to use the static image service over the map tile service, you may want to consider how you would like to interact with the rendered map. If the map contents will be relatively unchanging, a static map is a good choice. If you want to support a lot of zooming, panning and changing of the map content, the map tile service would be a better choice. * * Service also provides Image Composition functionality to get a static image back with additional data like; pushpins and geometry overlays with following capabilities. * @@ -149,7 +142,7 @@ export interface GetMapStaticImage { * |20 | 0.0054931641 | 0.0025939941 | */ get( - options?: RenderGetMapStaticImageParameters + options?: RenderGetMapStaticImageParameters, ): StreamableMethod< RenderGetMapStaticImage200Response | RenderGetMapStaticImageDefaultResponse >; @@ -157,12 +150,11 @@ export interface GetMapStaticImage { export interface GetCopyrightFromBoundingBox { /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * Returns copyright information for a given bounding box. Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates + * Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates */ get( - options: RenderGetCopyrightFromBoundingBoxParameters + options: RenderGetCopyrightFromBoundingBoxParameters, ): StreamableMethod< | RenderGetCopyrightFromBoundingBox200Response | RenderGetCopyrightFromBoundingBoxDefaultResponse @@ -171,13 +163,12 @@ export interface GetCopyrightFromBoundingBox { export interface GetCopyrightForTile { /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * Copyrights API is designed to serve copyright information for Render Tile service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions. + * In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions. * Returns the copyright information for a given tile. To obtain the copyright information for a particular tile, the request should specify the tile's zoom level and x and y coordinates (see: Zoom Levels and Tile Grid). */ get( - options: RenderGetCopyrightForTileParameters + options: RenderGetCopyrightForTileParameters, ): StreamableMethod< | RenderGetCopyrightForTile200Response | RenderGetCopyrightForTileDefaultResponse @@ -186,13 +177,12 @@ export interface GetCopyrightForTile { export interface GetCopyrightForWorld { /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * Copyrights API is designed to serve copyright information for Render Tile service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions. - * Returns the copyright information for the world. To obtain the default copyright information for the whole world, do not specify a tile or bounding box. + * In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions. + * To obtain the default copyright information for the whole world, do not specify a tile or bounding box. */ get( - options?: RenderGetCopyrightForWorldParameters + options?: RenderGetCopyrightForWorldParameters, ): StreamableMethod< | RenderGetCopyrightForWorld200Response | RenderGetCopyrightForWorldDefaultResponse @@ -211,24 +201,24 @@ export interface Routes { /** Resource for '/map/copyright/caption/\{format\}' has methods for the following verbs: get */ ( path: "/map/copyright/caption/{format}", - format: "json" | "xml" + format: "json" | "xml", ): GetCopyrightCaption; /** Resource for '/map/static/\{format\}' has methods for the following verbs: get */ (path: "/map/static/{format}", format: "png"): GetMapStaticImage; /** Resource for '/map/copyright/bounding/\{format\}' has methods for the following verbs: get */ ( path: "/map/copyright/bounding/{format}", - format: "json" | "xml" + format: "json" | "xml", ): GetCopyrightFromBoundingBox; /** Resource for '/map/copyright/tile/\{format\}' has methods for the following verbs: get */ ( path: "/map/copyright/tile/{format}", - format: "json" | "xml" + format: "json" | "xml", ): GetCopyrightForTile; /** Resource for '/map/copyright/world/\{format\}' has methods for the following verbs: get */ ( path: "/map/copyright/world/{format}", - format: "json" | "xml" + format: "json" | "xml", ): GetCopyrightForWorld; } diff --git a/sdk/maps/maps-render-rest/src/generated/index.ts b/sdk/maps/maps-render-rest/generated/index.ts similarity index 100% rename from sdk/maps/maps-render-rest/src/generated/index.ts rename to sdk/maps/maps-render-rest/generated/index.ts diff --git a/sdk/maps/maps-render-rest/src/generated/isUnexpected.ts b/sdk/maps/maps-render-rest/generated/isUnexpected.ts similarity index 67% rename from sdk/maps/maps-render-rest/src/generated/isUnexpected.ts rename to sdk/maps/maps-render-rest/generated/isUnexpected.ts index f4f6efcb0eb1..98457b89c53c 100644 --- a/sdk/maps/maps-render-rest/src/generated/isUnexpected.ts +++ b/sdk/maps/maps-render-rest/generated/isUnexpected.ts @@ -19,7 +19,7 @@ import { RenderGetCopyrightForTile200Response, RenderGetCopyrightForTileDefaultResponse, RenderGetCopyrightForWorld200Response, - RenderGetCopyrightForWorldDefaultResponse + RenderGetCopyrightForWorldDefaultResponse, } from "./responses"; const responseMap: Record = { @@ -31,49 +31,49 @@ const responseMap: Record = { "GET /map/static/{format}": ["200"], "GET /map/copyright/bounding/{format}": ["200"], "GET /map/copyright/tile/{format}": ["200"], - "GET /map/copyright/world/{format}": ["200"] + "GET /map/copyright/world/{format}": ["200"], }; export function isUnexpected( - response: RenderGetMapTile200Response | RenderGetMapTileDefaultResponse + response: RenderGetMapTile200Response | RenderGetMapTileDefaultResponse, ): response is RenderGetMapTileDefaultResponse; export function isUnexpected( - response: RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse + response: RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse, ): response is RenderGetMapTilesetDefaultResponse; export function isUnexpected( response: | RenderGetMapAttribution200Response - | RenderGetMapAttributionDefaultResponse + | RenderGetMapAttributionDefaultResponse, ): response is RenderGetMapAttributionDefaultResponse; export function isUnexpected( response: | RenderGetMapStateTile200Response - | RenderGetMapStateTileDefaultResponse + | RenderGetMapStateTileDefaultResponse, ): response is RenderGetMapStateTileDefaultResponse; export function isUnexpected( response: | RenderGetCopyrightCaption200Response - | RenderGetCopyrightCaptionDefaultResponse + | RenderGetCopyrightCaptionDefaultResponse, ): response is RenderGetCopyrightCaptionDefaultResponse; export function isUnexpected( response: | RenderGetMapStaticImage200Response - | RenderGetMapStaticImageDefaultResponse + | RenderGetMapStaticImageDefaultResponse, ): response is RenderGetMapStaticImageDefaultResponse; export function isUnexpected( response: | RenderGetCopyrightFromBoundingBox200Response - | RenderGetCopyrightFromBoundingBoxDefaultResponse + | RenderGetCopyrightFromBoundingBoxDefaultResponse, ): response is RenderGetCopyrightFromBoundingBoxDefaultResponse; export function isUnexpected( response: | RenderGetCopyrightForTile200Response - | RenderGetCopyrightForTileDefaultResponse + | RenderGetCopyrightForTileDefaultResponse, ): response is RenderGetCopyrightForTileDefaultResponse; export function isUnexpected( response: | RenderGetCopyrightForWorld200Response - | RenderGetCopyrightForWorldDefaultResponse + | RenderGetCopyrightForWorldDefaultResponse, ): response is RenderGetCopyrightForWorldDefaultResponse; export function isUnexpected( response: @@ -94,7 +94,7 @@ export function isUnexpected( | RenderGetCopyrightForTile200Response | RenderGetCopyrightForTileDefaultResponse | RenderGetCopyrightForWorld200Response - | RenderGetCopyrightForWorldDefaultResponse + | RenderGetCopyrightForWorldDefaultResponse, ): response is | RenderGetMapTileDefaultResponse | RenderGetMapTilesetDefaultResponse @@ -110,14 +110,20 @@ export function isUnexpected( const method = response.request.method; let pathDetails = responseMap[`${method} ${url.pathname}`]; if (!pathDetails) { - pathDetails = geParametrizedPathSuccess(method, url.pathname); + pathDetails = getParametrizedPathSuccess(method, url.pathname); } return !pathDetails.includes(response.status); } -function geParametrizedPathSuccess(method: string, path: string): string[] { +function getParametrizedPathSuccess(method: string, path: string): string[] { const pathParts = path.split("/"); + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: string[] = []; + // Iterate the responseMap to find a match for (const [key, value] of Object.entries(responseMap)) { // Extracting the path from the map key which is in format @@ -129,49 +135,52 @@ function geParametrizedPathSuccess(method: string, path: string): string[] { // Get each part of the url path const candidateParts = candidatePath.split("/"); - // If the candidate and actual paths don't match in size - // we move on to the next candidate path - if ( - candidateParts.length === pathParts.length && - hasParametrizedPath(key) + // track if we have found a match to return the values found. + let found = true; + for ( + let i = candidateParts.length - 1, j = pathParts.length - 1; + i >= 1 && j >= 1; + i--, j-- ) { - // track if we have found a match to return the values found. - let found = true; - for (let i = 0; i < candidateParts.length; i++) { - if ( - candidateParts[i]?.startsWith("{") && - candidateParts[i]?.endsWith("}") - ) { - // If the current part of the candidate is a "template" part - // it is a match with the actual path part on hand - // skip as the parameterized part can match anything - continue; - } + if ( + candidateParts[i]?.startsWith("{") && + candidateParts[i]?.indexOf("}") !== -1 + ) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp( + `${candidateParts[i]?.slice(start, end)}`, + ).test(pathParts[j] || ""); - // If the candidate part is not a template and - // the parts don't match mark the candidate as not found - // to move on with the next candidate path. - if (candidateParts[i] !== pathParts[i]) { + if (!isMatched) { found = false; break; } + continue; } - // We finished evaluating the current candidate parts - // if all parts matched we return the success values form - // the path mapping. - if (found) { - return value; + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; } } - } - // No match was found, return an empty array. - return []; -} + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } -function hasParametrizedPath(path: string): boolean { - return path.includes("/{"); + return matchedValue; } function getPathFromMapKey(mapKey: string): string { diff --git a/sdk/maps/maps-render-rest/generated/logger.ts b/sdk/maps/maps-render-rest/generated/logger.ts new file mode 100644 index 000000000000..7b7d617ef8e3 --- /dev/null +++ b/sdk/maps/maps-render-rest/generated/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("maps-render"); diff --git a/sdk/maps/maps-render-rest/generated/mapsRenderClient.ts b/sdk/maps/maps-render-rest/generated/mapsRenderClient.ts new file mode 100644 index 000000000000..9675151de76f --- /dev/null +++ b/sdk/maps/maps-render-rest/generated/mapsRenderClient.ts @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { getClient, ClientOptions } from "@azure-rest/core-client"; +import { logger } from "./logger"; +import { KeyCredential } from "@azure/core-auth"; +import { MapsRenderClient } from "./clientDefinitions"; + +/** The optional parameters for the client */ +export interface MapsRenderClientOptions extends ClientOptions { + /** The api version option of the client */ + apiVersion?: string; +} + +/** + * Initialize a new instance of `MapsRenderClient` + * @param credentials - uniquely identify client credential + * @param options - the parameter for all optional parameters + */ +export default function createClient( + credentials: KeyCredential, + { apiVersion = "2022-08-01", ...options }: MapsRenderClientOptions = {}, +): MapsRenderClient { + const endpointUrl = + options.endpoint ?? options.baseUrl ?? `https://atlas.microsoft.com`; + const userAgentInfo = `azsdk-js-maps-render-rest/1.0.0-beta.4`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}` + : `${userAgentInfo}`; + options = { + ...options, + userAgentOptions: { + userAgentPrefix, + }, + loggingOptions: { + logger: options.loggingOptions?.logger ?? logger.info, + }, + credentials: { + apiKeyHeaderName: + options.credentials?.apiKeyHeaderName ?? "subscription-key", + }, + }; + const client = getClient( + endpointUrl, + credentials, + options, + ) as MapsRenderClient; + + client.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + client.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version") && apiVersion) { + req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + + return client; +} diff --git a/sdk/maps/maps-render-rest/src/generated/outputModels.ts b/sdk/maps/maps-render-rest/generated/outputModels.ts similarity index 86% rename from sdk/maps/maps-render-rest/src/generated/outputModels.ts rename to sdk/maps/maps-render-rest/generated/outputModels.ts index 010874250f03..e2e68915b470 100644 --- a/sdk/maps/maps-render-rest/src/generated/outputModels.ts +++ b/sdk/maps/maps-render-rest/generated/outputModels.ts @@ -10,23 +10,23 @@ export interface ErrorResponseOutput { /** The error detail. */ export interface ErrorDetailOutput { /** The error code. */ - code?: string; + readonly code?: string; /** The error message. */ - message?: string; + readonly message?: string; /** The error target. */ - target?: string; + readonly target?: string; /** The error details. */ - details?: Array; + readonly details?: Array; /** The error additional info. */ - additionalInfo?: Array; + readonly additionalInfo?: Array; } /** The resource management error additional info. */ export interface ErrorAdditionalInfoOutput { /** The additional info type. */ - type?: string; + readonly type?: string; /** The additional info. */ - info?: Record; + readonly info?: Record; } /** Metadata for a tileset in the TileJSON format. */ @@ -72,32 +72,32 @@ export interface MapAttributionOutput { /** This object is returned from a successful copyright call */ export interface CopyrightCaptionOutput { /** Format Version property */ - formatVersion?: string; + readonly formatVersion?: string; /** Copyrights Caption property */ - copyrightsCaption: string; + readonly copyrightsCaption: string; } /** This object is returned from a successful copyright request */ export interface CopyrightOutput { /** Format Version property */ - formatVersion?: string; + readonly formatVersion?: string; /** General Copyrights array */ - generalCopyrights?: Array; + readonly generalCopyrights?: Array; /** Regions array */ - regions?: Array; + readonly regions?: Array; } export interface RegionCopyrightsOutput { /** Copyrights array */ - copyrights: Array; + readonly copyrights: Array; /** Country property */ - country: RegionCopyrightsCountryOutput; + readonly country: RegionCopyrightsCountryOutput; } /** Country property */ export interface RegionCopyrightsCountryOutput { /** ISO3 property */ - ISO3: string; + readonly ISO3: string; /** Label property */ - label: string; + readonly label: string; } diff --git a/sdk/maps/maps-render-rest/src/generated/parameters.ts b/sdk/maps/maps-render-rest/generated/parameters.ts similarity index 94% rename from sdk/maps/maps-render-rest/src/generated/parameters.ts rename to sdk/maps/maps-render-rest/generated/parameters.ts index 921d769d7e41..8bb5c6a2da6b 100644 --- a/sdk/maps/maps-render-rest/src/generated/parameters.ts +++ b/sdk/maps/maps-render-rest/generated/parameters.ts @@ -4,7 +4,7 @@ import { RequestParameters } from "@azure-rest/core-client"; export interface RenderGetMapTileQueryParamProperties { - /** A tileset is a collection of raster or vector data broken up into a uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using [Azure Maps Creator](https://aka.ms/amcreator) are generated through the [Tileset Create API](https://docs.microsoft.com/en-us/rest/api/maps/tileset). The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. */ + /** A tileset is a collection of raster or vector data broken up into a uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using [Azure Maps Creator](https://aka.ms/amcreator) are generated through the [Tileset Create API](https://docs.microsoft.com/rest/api/maps-creator/tileset). The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. */ tilesetId: | "microsoft.base" | "microsoft.base.labels" @@ -31,7 +31,7 @@ export interface RenderGetMapTileQueryParamProperties { /** * Zoom level for the desired tile. * - * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid) for details. + * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details. */ zoom: number; /** @@ -95,7 +95,7 @@ export type RenderGetMapTileParameters = RenderGetMapTileQueryParam & RequestParameters; export interface RenderGetMapTilesetQueryParamProperties { - /** A tileset is a collection of raster or vector data broken up into a uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using [Azure Maps Creator](https://aka.ms/amcreator) are generated through the [Tileset Create API](https://docs.microsoft.com/en-us/rest/api/maps/tileset). The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. */ + /** A tileset is a collection of raster or vector data broken up into a uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using [Azure Maps Creator](https://aka.ms/amcreator) are generated through the [Tileset Create API](https://docs.microsoft.com/rest/api/maps-creator/tileset). The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. */ tilesetId: | "microsoft.base" | "microsoft.base.labels" @@ -129,7 +129,7 @@ export type RenderGetMapTilesetParameters = RenderGetMapTilesetQueryParam & RequestParameters; export interface RenderGetMapAttributionQueryParamProperties { - /** A tileset is a collection of raster or vector data broken up into a uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using [Azure Maps Creator](https://aka.ms/amcreator) are generated through the [Tileset Create API](https://docs.microsoft.com/en-us/rest/api/maps/tileset). The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. */ + /** A tileset is a collection of raster or vector data broken up into a uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using [Azure Maps Creator](https://aka.ms/amcreator) are generated through the [Tileset Create API](https://docs.microsoft.com/rest/api/maps-creator/tileset). The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. */ tilesetId: | "microsoft.base" | "microsoft.base.labels" @@ -163,14 +163,14 @@ export interface RenderGetMapAttributionQueryParam { queryParameters: RenderGetMapAttributionQueryParamProperties; } -export type RenderGetMapAttributionParameters = RenderGetMapAttributionQueryParam & - RequestParameters; +export type RenderGetMapAttributionParameters = + RenderGetMapAttributionQueryParam & RequestParameters; export interface RenderGetMapStateTileQueryParamProperties { /** * Zoom level for the desired tile. * - * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid) for details. + * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details. */ zoom: number; /** @@ -459,8 +459,8 @@ export interface RenderGetMapStaticImageQueryParam { queryParameters?: RenderGetMapStaticImageQueryParamProperties; } -export type RenderGetMapStaticImageParameters = RenderGetMapStaticImageQueryParam & - RequestParameters; +export type RenderGetMapStaticImageParameters = + RenderGetMapStaticImageQueryParam & RequestParameters; export interface RenderGetCopyrightFromBoundingBoxQueryParamProperties { /** Minimum coordinates (south-west point) of bounding box in latitude longitude coordinate system. E.g. 52.41064,4.84228 */ @@ -475,14 +475,14 @@ export interface RenderGetCopyrightFromBoundingBoxQueryParam { queryParameters: RenderGetCopyrightFromBoundingBoxQueryParamProperties; } -export type RenderGetCopyrightFromBoundingBoxParameters = RenderGetCopyrightFromBoundingBoxQueryParam & - RequestParameters; +export type RenderGetCopyrightFromBoundingBoxParameters = + RenderGetCopyrightFromBoundingBoxQueryParam & RequestParameters; export interface RenderGetCopyrightForTileQueryParamProperties { /** * Zoom level for the desired tile. * - * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid) for details. + * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details. */ zoom: number; /** @@ -505,8 +505,8 @@ export interface RenderGetCopyrightForTileQueryParam { queryParameters: RenderGetCopyrightForTileQueryParamProperties; } -export type RenderGetCopyrightForTileParameters = RenderGetCopyrightForTileQueryParam & - RequestParameters; +export type RenderGetCopyrightForTileParameters = + RenderGetCopyrightForTileQueryParam & RequestParameters; export interface RenderGetCopyrightForWorldQueryParamProperties { /** Yes/no value to exclude textual data from response. Only images and country/region names will be in response. */ @@ -517,5 +517,5 @@ export interface RenderGetCopyrightForWorldQueryParam { queryParameters?: RenderGetCopyrightForWorldQueryParamProperties; } -export type RenderGetCopyrightForWorldParameters = RenderGetCopyrightForWorldQueryParam & - RequestParameters; +export type RenderGetCopyrightForWorldParameters = + RenderGetCopyrightForWorldQueryParam & RequestParameters; diff --git a/sdk/maps/maps-render-rest/src/generated/responses.ts b/sdk/maps/maps-render-rest/generated/responses.ts similarity index 54% rename from sdk/maps/maps-render-rest/src/generated/responses.ts rename to sdk/maps/maps-render-rest/generated/responses.ts index 572493809090..1e25c614368c 100644 --- a/sdk/maps/maps-render-rest/src/generated/responses.ts +++ b/sdk/maps/maps-render-rest/generated/responses.ts @@ -8,7 +8,7 @@ import { MapTilesetOutput, MapAttributionOutput, CopyrightCaptionOutput, - CopyrightOutput + CopyrightOutput, } from "./outputModels"; export interface RenderGetMapTile200Headers { @@ -17,9 +17,9 @@ export interface RenderGetMapTile200Headers { } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * ** * - * The Get Map Tiles API allows users to request map tiles in vector or raster formats typically to be integrated into a map control or SDK. Some example tiles that can be requested are Azure Maps road tiles, real-time Weather Radar tiles or the map tiles created using [Azure Maps Creator](https://aka.ms/amcreator). By default, Azure Maps uses vector tiles for its web map control (Web SDK) and Android SDK. + * The `Get Map Tiles` API is an HTTP `GET` request that allows users to request map tiles in vector or raster formats, typically to be integrated into a map control or SDK. Some example tiles that can be requested are Azure Maps road tiles, real-time Weather Radar tiles or the map tiles created using [Azure Maps Creator](https://aka.ms/amcreator). By default, Azure Maps uses vector tiles for its web map control ([Web SDK](/azure/azure-maps/about-azure-maps#web-sdk)) and [Android SDK](/azure/azure-maps/about-azure-maps#android-sdk). */ export interface RenderGetMapTile200Response extends HttpResponse { status: "200"; @@ -29,9 +29,9 @@ export interface RenderGetMapTile200Response extends HttpResponse { } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * ** * - * The Get Map Tiles API allows users to request map tiles in vector or raster formats typically to be integrated into a map control or SDK. Some example tiles that can be requested are Azure Maps road tiles, real-time Weather Radar tiles or the map tiles created using [Azure Maps Creator](https://aka.ms/amcreator). By default, Azure Maps uses vector tiles for its web map control (Web SDK) and Android SDK. + * The `Get Map Tiles` API is an HTTP `GET` request that allows users to request map tiles in vector or raster formats, typically to be integrated into a map control or SDK. Some example tiles that can be requested are Azure Maps road tiles, real-time Weather Radar tiles or the map tiles created using [Azure Maps Creator](https://aka.ms/amcreator). By default, Azure Maps uses vector tiles for its web map control ([Web SDK](/azure/azure-maps/about-azure-maps#web-sdk)) and [Android SDK](/azure/azure-maps/about-azure-maps#android-sdk). */ export interface RenderGetMapTileDefaultResponse extends HttpResponse { status: string; @@ -39,9 +39,9 @@ export interface RenderGetMapTileDefaultResponse extends HttpResponse { } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * ** * - * The Get Map Tileset API allows users to request metadata for a tileset. + * The `Get Map Tileset` API is an HTTP `GET` request allows users to request [metadata](#maptileset) for a tileset. */ export interface RenderGetMapTileset200Response extends HttpResponse { status: "200"; @@ -49,9 +49,9 @@ export interface RenderGetMapTileset200Response extends HttpResponse { } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * ** * - * The Get Map Tileset API allows users to request metadata for a tileset. + * The `Get Map Tileset` API is an HTTP `GET` request allows users to request [metadata](#maptileset) for a tileset. */ export interface RenderGetMapTilesetDefaultResponse extends HttpResponse { status: string; @@ -59,9 +59,8 @@ export interface RenderGetMapTilesetDefaultResponse extends HttpResponse { } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * The Get Map Attribution API allows users to request map copyright attribution information for a section of a tileset. + * The `Get Map Attribution` API is an HTTP `GET` request that returns map copyright attribution information for a section of a tileset as defined by the four bounding box coordinates and zoom level. */ export interface RenderGetMapAttribution200Response extends HttpResponse { status: "200"; @@ -69,9 +68,8 @@ export interface RenderGetMapAttribution200Response extends HttpResponse { } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * The Get Map Attribution API allows users to request map copyright attribution information for a section of a tileset. + * The `Get Map Attribution` API is an HTTP `GET` request that returns map copyright attribution information for a section of a tileset as defined by the four bounding box coordinates and zoom level. */ export interface RenderGetMapAttributionDefaultResponse extends HttpResponse { status: string; @@ -84,9 +82,8 @@ export interface RenderGetMapStateTile200Headers { } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * Fetches state tiles in vector format typically to be integrated into indoor maps module of map control or SDK. The map control will call this API after user turns on dynamic styling (see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid)) + * The `Get Map State Tile` API is an HTTP `GET` request that fetches state tiles in vector format, typically to be integrated into the indoor maps module of a map control or SDK. The map control calls this API after dynamic styling is turned on. For more information, see [Zoom Levels and Tile Grid](/azure/azure-maps/zoom-levels-and-tile-grid). */ export interface RenderGetMapStateTile200Response extends HttpResponse { status: "200"; @@ -96,9 +93,8 @@ export interface RenderGetMapStateTile200Response extends HttpResponse { } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * Fetches state tiles in vector format typically to be integrated into indoor maps module of map control or SDK. The map control will call this API after user turns on dynamic styling (see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid)) + * The `Get Map State Tile` API is an HTTP `GET` request that fetches state tiles in vector format, typically to be integrated into the indoor maps module of a map control or SDK. The map control calls this API after dynamic styling is turned on. For more information, see [Zoom Levels and Tile Grid](/azure/azure-maps/zoom-levels-and-tile-grid). */ export interface RenderGetMapStateTileDefaultResponse extends HttpResponse { status: string; @@ -106,14 +102,10 @@ export interface RenderGetMapStateTileDefaultResponse extends HttpResponse { } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * Copyrights API is designed to serve copyright information for Render Tile - * service. In addition to basic copyright for the whole map, API is serving - * specific groups of copyrights for some countries/regions. + * The `Get Copyright Caption` API is an HTTP `GET` request designed to serve copyright information to be use in conjunction with tiles requested from the Render service. In addition to a basic copyright for the whole map, it can serve specific groups of copyrights for some countries/regions. * - * As an alternative to copyrights for map request, one can receive captions - * for displaying the map provider information on the map. + * As an alternative to copyrights for map request, one can receive captions for displaying the map provider information on the map. */ export interface RenderGetCopyrightCaption200Response extends HttpResponse { status: "200"; @@ -121,14 +113,10 @@ export interface RenderGetCopyrightCaption200Response extends HttpResponse { } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * Copyrights API is designed to serve copyright information for Render Tile - * service. In addition to basic copyright for the whole map, API is serving - * specific groups of copyrights for some countries/regions. + * The `Get Copyright Caption` API is an HTTP `GET` request designed to serve copyright information to be use in conjunction with tiles requested from the Render service. In addition to a basic copyright for the whole map, it can serve specific groups of copyrights for some countries/regions. * - * As an alternative to copyrights for map request, one can receive captions - * for displaying the map provider information on the map. + * As an alternative to copyrights for map request, one can receive captions for displaying the map provider information on the map. */ export interface RenderGetCopyrightCaptionDefaultResponse extends HttpResponse { status: string; @@ -141,9 +129,8 @@ export interface RenderGetMapStaticImage200Headers { } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * The static image service renders a user-defined, rectangular image containing a map section using a zoom level from 0 to 20. The supported resolution range for the map image is from 1x1 to 8192x8192. If you are deciding when to use the static image service over the map tile service, you may want to consider how you would like to interact with the rendered map. If the map contents will be relatively unchanging, a static map is a good choice. If you want to support a lot of zooming, panning and changing of the map content, the map tile service would be a better choice. + * The supported resolution range for the map image is from 1x1 to 8192x8192. If you are deciding when to use the static image service over the map tile service, you may want to consider how you would like to interact with the rendered map. If the map contents will be relatively unchanging, a static map is a good choice. If you want to support a lot of zooming, panning and changing of the map content, the map tile service would be a better choice. * * Service also provides Image Composition functionality to get a static image back with additional data like; pushpins and geometry overlays with following capabilities. * @@ -190,9 +177,8 @@ export interface RenderGetMapStaticImage200Response extends HttpResponse { } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * The static image service renders a user-defined, rectangular image containing a map section using a zoom level from 0 to 20. The supported resolution range for the map image is from 1x1 to 8192x8192. If you are deciding when to use the static image service over the map tile service, you may want to consider how you would like to interact with the rendered map. If the map contents will be relatively unchanging, a static map is a good choice. If you want to support a lot of zooming, panning and changing of the map content, the map tile service would be a better choice. + * The supported resolution range for the map image is from 1x1 to 8192x8192. If you are deciding when to use the static image service over the map tile service, you may want to consider how you would like to interact with the rendered map. If the map contents will be relatively unchanging, a static map is a good choice. If you want to support a lot of zooming, panning and changing of the map content, the map tile service would be a better choice. * * Service also provides Image Composition functionality to get a static image back with additional data like; pushpins and geometry overlays with following capabilities. * @@ -237,9 +223,8 @@ export interface RenderGetMapStaticImageDefaultResponse extends HttpResponse { } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * Returns copyright information for a given bounding box. Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates + * Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates */ export interface RenderGetCopyrightFromBoundingBox200Response extends HttpResponse { @@ -248,9 +233,8 @@ export interface RenderGetCopyrightFromBoundingBox200Response } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * Returns copyright information for a given bounding box. Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates + * Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates */ export interface RenderGetCopyrightFromBoundingBoxDefaultResponse extends HttpResponse { @@ -259,9 +243,8 @@ export interface RenderGetCopyrightFromBoundingBoxDefaultResponse } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * Copyrights API is designed to serve copyright information for Render Tile service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions. + * In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions. * Returns the copyright information for a given tile. To obtain the copyright information for a particular tile, the request should specify the tile's zoom level and x and y coordinates (see: Zoom Levels and Tile Grid). */ export interface RenderGetCopyrightForTile200Response extends HttpResponse { @@ -270,9 +253,8 @@ export interface RenderGetCopyrightForTile200Response extends HttpResponse { } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * Copyrights API is designed to serve copyright information for Render Tile service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions. + * In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions. * Returns the copyright information for a given tile. To obtain the copyright information for a particular tile, the request should specify the tile's zoom level and x and y coordinates (see: Zoom Levels and Tile Grid). */ export interface RenderGetCopyrightForTileDefaultResponse extends HttpResponse { @@ -281,10 +263,9 @@ export interface RenderGetCopyrightForTileDefaultResponse extends HttpResponse { } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * Copyrights API is designed to serve copyright information for Render Tile service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions. - * Returns the copyright information for the world. To obtain the default copyright information for the whole world, do not specify a tile or bounding box. + * In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions. + * To obtain the default copyright information for the whole world, do not specify a tile or bounding box. */ export interface RenderGetCopyrightForWorld200Response extends HttpResponse { status: "200"; @@ -292,10 +273,9 @@ export interface RenderGetCopyrightForWorld200Response extends HttpResponse { } /** - * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). * - * Copyrights API is designed to serve copyright information for Render Tile service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions. - * Returns the copyright information for the world. To obtain the default copyright information for the whole world, do not specify a tile or bounding box. + * In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions. + * To obtain the default copyright information for the whole world, do not specify a tile or bounding box. */ export interface RenderGetCopyrightForWorldDefaultResponse extends HttpResponse { diff --git a/sdk/maps/maps-render-rest/review/maps-render.api.md b/sdk/maps/maps-render-rest/review/maps-render.api.md index d9b55d2beeaa..61b5ce471d35 100644 --- a/sdk/maps/maps-render-rest/review/maps-render.api.md +++ b/sdk/maps/maps-render-rest/review/maps-render.api.md @@ -31,15 +31,15 @@ export interface CircularPathOptions { // @public export interface CopyrightCaptionOutput { - copyrightsCaption: string; - formatVersion?: string; + readonly copyrightsCaption: string; + readonly formatVersion?: string; } // @public export interface CopyrightOutput { - formatVersion?: string; - generalCopyrights?: Array; - regions?: Array; + readonly formatVersion?: string; + readonly generalCopyrights?: Array; + readonly regions?: Array; } // @public @@ -50,17 +50,17 @@ export function createPinsQuery(pinSets: PinSet[]): string; // @public export interface ErrorAdditionalInfoOutput { - info?: Record; - type?: string; + readonly info?: Record; + readonly type?: string; } // @public export interface ErrorDetailOutput { - additionalInfo?: Array; - code?: string; - details?: Array; - message?: string; - target?: string; + readonly additionalInfo?: Array; + readonly code?: string; + readonly details?: Array; + readonly message?: string; + readonly target?: string; } // @public @@ -160,6 +160,11 @@ export type MapsRenderClient = Client & { path: Routes; }; +// @public +export interface MapsRenderClientOptions extends ClientOptions { + apiVersion?: string; +} + // @public export interface MapTilesetOutput { attribution?: string; @@ -227,14 +232,14 @@ export function positionToTileXY(position: LatLon, zoom: number, tileSize: "512" // @public export interface RegionCopyrightsCountryOutput { - ISO3: string; - label: string; + readonly ISO3: string; + readonly label: string; } // @public (undocumented) export interface RegionCopyrightsOutput { - copyrights: Array; - country: RegionCopyrightsCountryOutput; + readonly copyrights: Array; + readonly country: RegionCopyrightsCountryOutput; } // @public diff --git a/sdk/maps/maps-render-rest/samples-dev/getCopyrightCaption.ts b/sdk/maps/maps-render-rest/samples-dev/getCopyrightCaption.ts index 2b007dca41ab..94d05fef95df 100644 --- a/sdk/maps/maps-render-rest/samples-dev/getCopyrightCaption.ts +++ b/sdk/maps/maps-render-rest/samples-dev/getCopyrightCaption.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. import { DefaultAzureCredential } from "@azure/identity"; -import { isUnexpected } from "../src/generated"; +import { isUnexpected } from "../generated"; import MapsRender from "../src/mapsRender"; /** diff --git a/sdk/maps/maps-render-rest/samples-dev/getCopyrightForTile.ts b/sdk/maps/maps-render-rest/samples-dev/getCopyrightForTile.ts index b63311189226..c6d942626039 100644 --- a/sdk/maps/maps-render-rest/samples-dev/getCopyrightForTile.ts +++ b/sdk/maps/maps-render-rest/samples-dev/getCopyrightForTile.ts @@ -3,7 +3,7 @@ import { positionToTileXY } from "@azure-rest/maps-render"; import { DefaultAzureCredential } from "@azure/identity"; -import { isUnexpected } from "../src/generated"; +import { isUnexpected } from "../generated"; import MapsRender from "../src/mapsRender"; /** diff --git a/sdk/maps/maps-render-rest/samples-dev/getCopyrightForWorld.ts b/sdk/maps/maps-render-rest/samples-dev/getCopyrightForWorld.ts index 3e748888151d..723253224221 100644 --- a/sdk/maps/maps-render-rest/samples-dev/getCopyrightForWorld.ts +++ b/sdk/maps/maps-render-rest/samples-dev/getCopyrightForWorld.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. import { DefaultAzureCredential } from "@azure/identity"; -import { isUnexpected } from "../src/generated"; +import { isUnexpected } from "../generated"; import MapsRender from "../src/mapsRender"; /** diff --git a/sdk/maps/maps-render-rest/samples-dev/getCopyrightFromBoundingBox.ts b/sdk/maps/maps-render-rest/samples-dev/getCopyrightFromBoundingBox.ts index e9f2cf86ded8..1f8974593361 100644 --- a/sdk/maps/maps-render-rest/samples-dev/getCopyrightFromBoundingBox.ts +++ b/sdk/maps/maps-render-rest/samples-dev/getCopyrightFromBoundingBox.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. import { DefaultAzureCredential } from "@azure/identity"; -import { isUnexpected } from "../src/generated"; +import { isUnexpected } from "../generated"; import MapsRender from "../src/mapsRender"; /** diff --git a/sdk/maps/maps-render-rest/samples-dev/getMapAttribution.ts b/sdk/maps/maps-render-rest/samples-dev/getMapAttribution.ts index 3bfb242c4755..fa70c96f1936 100644 --- a/sdk/maps/maps-render-rest/samples-dev/getMapAttribution.ts +++ b/sdk/maps/maps-render-rest/samples-dev/getMapAttribution.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. import { DefaultAzureCredential } from "@azure/identity"; -import { isUnexpected } from "../src/generated"; +import { isUnexpected } from "../generated"; import MapsRender from "../src/mapsRender"; /** diff --git a/sdk/maps/maps-render-rest/samples-dev/getMapTileset.ts b/sdk/maps/maps-render-rest/samples-dev/getMapTileset.ts index d6bcb9d41e8a..a042b794f5fc 100644 --- a/sdk/maps/maps-render-rest/samples-dev/getMapTileset.ts +++ b/sdk/maps/maps-render-rest/samples-dev/getMapTileset.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. import { DefaultAzureCredential } from "@azure/identity"; -import { isUnexpected } from "../src/generated"; +import { isUnexpected } from "../generated"; import MapsRender from "../src/mapsRender"; /** diff --git a/sdk/maps/maps-render-rest/src/generated/mapsRenderClient.ts b/sdk/maps/maps-render-rest/src/generated/mapsRenderClient.ts deleted file mode 100644 index 6ad3ef6526ea..000000000000 --- a/sdk/maps/maps-render-rest/src/generated/mapsRenderClient.ts +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { getClient, ClientOptions } from "@azure-rest/core-client"; -import { KeyCredential } from "@azure/core-auth"; -import { MapsRenderClient } from "./clientDefinitions"; - -/** - * Initialize a new instance of the class MapsRenderClient class. - * @param credentials type: KeyCredential - */ -export default function createClient( - credentials: KeyCredential, - options: ClientOptions = {} -): MapsRenderClient { - const baseUrl = options.baseUrl ?? `https://atlas.microsoft.com`; - options.apiVersion = options.apiVersion ?? "2022-08-01"; - options = { - ...options, - credentials: { - apiKeyHeaderName: "subscription-key" - } - }; - - const userAgentInfo = `azsdk-js-maps-render-rest/1.0.0-beta.2`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}` - : `${userAgentInfo}`; - options = { - ...options, - userAgentOptions: { - userAgentPrefix - } - }; - - const client = getClient(baseUrl, credentials, options) as MapsRenderClient; - - return client; -} diff --git a/sdk/maps/maps-render-rest/src/index.ts b/sdk/maps/maps-render-rest/src/index.ts index 9a5415ed5157..b7242c5581b3 100644 --- a/sdk/maps/maps-render-rest/src/index.ts +++ b/sdk/maps/maps-render-rest/src/index.ts @@ -3,7 +3,7 @@ import MapsRender from "./mapsRender"; -export * from "./generated"; +export * from "../generated"; export * from "./positionToTileXY"; export * from "./createPinsQuery"; export * from "./createPathQuery"; diff --git a/sdk/maps/maps-render-rest/src/mapsRender.ts b/sdk/maps/maps-render-rest/src/mapsRender.ts index 41cc50ba4082..279031ae38fc 100644 --- a/sdk/maps/maps-render-rest/src/mapsRender.ts +++ b/sdk/maps/maps-render-rest/src/mapsRender.ts @@ -11,8 +11,8 @@ import { } from "@azure/core-auth"; import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline"; import { createMapsClientIdPolicy } from "@azure/maps-common"; -import { MapsRenderClient } from "./generated"; -import createClient from "./generated/mapsRenderClient"; +import { MapsRenderClient } from "../generated"; +import createClient from "../generated/mapsRenderClient"; /** * Creates an instance of MapsRenderClient from a subscription key. diff --git a/sdk/maps/maps-render-rest/swagger/README.md b/sdk/maps/maps-render-rest/swagger/README.md index 2e33d264284d..9277571ee76f 100644 --- a/sdk/maps/maps-render-rest/swagger/README.md +++ b/sdk/maps/maps-render-rest/swagger/README.md @@ -8,6 +8,8 @@ The configuration is following the [RLC quick start guide](https://github.com/Az For the configuration property, please refer to [Index of AutoRestFlag](https://github.com/Azure/autorest/blob/main/docs/generate/flags.md). ```yaml +flavor: azure +openapi-type: data-plane package-name: "@azure-rest/maps-render" title: MapsRenderClient description: Azure Maps Render Client diff --git a/sdk/maps/maps-render-rest/tsconfig.json b/sdk/maps/maps-render-rest/tsconfig.json index 29ac8612d4fc..c5f35795813c 100644 --- a/sdk/maps/maps-render-rest/tsconfig.json +++ b/sdk/maps/maps-render-rest/tsconfig.json @@ -3,8 +3,19 @@ "compilerOptions": { "outDir": "./dist-esm", "declarationDir": "./types", - "paths": { "@azure-rest/maps-render": ["./src/index"] }, - "lib": ["DOM"] + "paths": { + "@azure-rest/maps-render": [ + "./src/index" + ] + }, + "lib": [ + "DOM" + ] }, - "include": ["src/**/*.ts", "./test/**/*.ts", "./samples-dev/**/*.ts"] + "include": [ + "src/**/*.ts", + "./test/**/*.ts", + "./samples-dev/**/*.ts", + "generated/logger.ts" + ] } From 52bef8113032717792c9935214a3361f081ac84f Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:48:53 +0800 Subject: [PATCH 2/7] update --- sdk/maps/maps-render-rest/package.json | 1 + sdk/maps/maps-render-rest/swagger/README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/maps/maps-render-rest/package.json b/sdk/maps/maps-render-rest/package.json index 3e92a31d7a2f..fd88c09421d3 100644 --- a/sdk/maps/maps-render-rest/package.json +++ b/sdk/maps/maps-render-rest/package.json @@ -65,6 +65,7 @@ "@azure-rest/core-client": "^1.0.0", "@azure/core-rest-pipeline": "^1.8.0", "@azure/maps-common": "1.0.0-beta.2", + "@azure/logger": "^1.0.0", "tslib": "^2.2.0" }, "devDependencies": { diff --git a/sdk/maps/maps-render-rest/swagger/README.md b/sdk/maps/maps-render-rest/swagger/README.md index 9277571ee76f..59502937e89d 100644 --- a/sdk/maps/maps-render-rest/swagger/README.md +++ b/sdk/maps/maps-render-rest/swagger/README.md @@ -31,7 +31,7 @@ rest-level-client: true security: AzureKey security-header-name: subscription-key use-extension: - "@autorest/typescript": "6.0.0-rc.3" + "@autorest/typescript": "latest" ``` ## Customization for Track 2 Generator From a6f75839853a6d69306a299319362043c0681e6d Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:04:45 +0800 Subject: [PATCH 3/7] Update tsconfig.json --- sdk/maps/maps-render-rest/tsconfig.json | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/sdk/maps/maps-render-rest/tsconfig.json b/sdk/maps/maps-render-rest/tsconfig.json index c5f35795813c..70cf988ad24a 100644 --- a/sdk/maps/maps-render-rest/tsconfig.json +++ b/sdk/maps/maps-render-rest/tsconfig.json @@ -4,18 +4,9 @@ "outDir": "./dist-esm", "declarationDir": "./types", "paths": { - "@azure-rest/maps-render": [ - "./src/index" - ] + "@azure-rest/maps-render": ["./src/index"] }, - "lib": [ - "DOM" - ] + "lib": ["DOM"] }, - "include": [ - "src/**/*.ts", - "./test/**/*.ts", - "./samples-dev/**/*.ts", - "generated/logger.ts" - ] + "include": ["src/**/*.ts", "./test/**/*.ts", "./samples-dev/**/*.ts"] } From f37685f00ad457d5c14c56ca08b0df6222014cf5 Mon Sep 17 00:00:00 2001 From: ZiWei Chen <98569699+kazrael2119@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:17:45 +0800 Subject: [PATCH 4/7] Update README.md --- sdk/maps/maps-render-rest/swagger/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/maps/maps-render-rest/swagger/README.md b/sdk/maps/maps-render-rest/swagger/README.md index 59502937e89d..3caf5442c48f 100644 --- a/sdk/maps/maps-render-rest/swagger/README.md +++ b/sdk/maps/maps-render-rest/swagger/README.md @@ -22,7 +22,7 @@ generate-metadata: false generate-test: false license-header: MICROSOFT_MIT_NO_VERSION output-folder: ../ -source-code-folder-path: ./src/generated +source-code-folder-path: ./generated input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/maps/data-plane/Render/stable/2022-08-01/render.json package-version: 1.0.0-beta.4 rest-level-client: true From 1b9992673452f4a2489f087572a8d896ef6b6247 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:58:07 +0800 Subject: [PATCH 5/7] Update CHANGELOG.md --- sdk/maps/maps-render-rest/CHANGELOG.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sdk/maps/maps-render-rest/CHANGELOG.md b/sdk/maps/maps-render-rest/CHANGELOG.md index 9c71036adb61..d9ad7452aa86 100644 --- a/sdk/maps/maps-render-rest/CHANGELOG.md +++ b/sdk/maps/maps-render-rest/CHANGELOG.md @@ -1,17 +1,14 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.4 (2024-09-30) ### Features Added - -### Breaking Changes +- refresh @azure-rest/maps-render sdk ### Bugs Fixed - Fix the Microsoft Entra ID authentication when providing `baseUrl`. -### Other Changes - ## 1.0.0-beta.3 (2024-01-09) ### Features Added From 52a5250823d87037fb59c3ffa084036a0587310c Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:19:16 +0800 Subject: [PATCH 6/7] delete unexpected file --- sdk/maps/maps-render-rest/g/logger.ts | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 sdk/maps/maps-render-rest/g/logger.ts diff --git a/sdk/maps/maps-render-rest/g/logger.ts b/sdk/maps/maps-render-rest/g/logger.ts deleted file mode 100644 index 7b7d617ef8e3..000000000000 --- a/sdk/maps/maps-render-rest/g/logger.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { createClientLogger } from "@azure/logger"; -export const logger = createClientLogger("maps-render"); From faeb391eaa04568c8ba088096da92cab4741123a Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:28:36 +0800 Subject: [PATCH 7/7] Update maps-render.api.md --- sdk/maps/maps-render-rest/review/maps-render.api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/maps/maps-render-rest/review/maps-render.api.md b/sdk/maps/maps-render-rest/review/maps-render.api.md index 641cfb802de4..301375bc33f0 100644 --- a/sdk/maps/maps-render-rest/review/maps-render.api.md +++ b/sdk/maps/maps-render-rest/review/maps-render.api.md @@ -7,7 +7,7 @@ import type { AzureKeyCredential } from '@azure/core-auth'; import type { AzureSASCredential } from '@azure/core-auth'; import { Client } from '@azure-rest/core-client'; -import type { ClientOptions } from '@azure-rest/core-client'; +import { ClientOptions } from '@azure-rest/core-client'; import { HttpResponse } from '@azure-rest/core-client'; import type { LatLon } from '@azure/maps-common'; import { RawHttpHeaders } from '@azure/core-rest-pipeline';