From 2253d68f94d48f826e4305c18614f8ddcf4ed76e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 18 Oct 2018 22:03:15 +0000 Subject: [PATCH 1/2] Generated from cf8d4b7ee4befc39b377d86669411e557618edf4 Add cognitiveservices\data-plane\NewsSearch\readme.typescript.md --- .../cognitiveservices-newssearch/.npmignore | 35 + .../cognitiveservices-newssearch/LICENSE.txt | 21 + .../cognitiveservices-newssearch/README.md | 100 + .../lib/models/index.ts | 2312 +++++++++++++++++ .../lib/models/mappers.ts | 686 +++++ .../lib/models/newsOperationsMappers.ts | 33 + .../lib/models/parameters.ts | 262 ++ .../lib/newsSearchAPIClient.ts | 39 + .../lib/newsSearchAPIClientContext.ts | 42 + .../lib/operations/index.ts | 11 + .../lib/operations/newsOperations.ts | 239 ++ .../cognitiveservices-newssearch/package.json | 41 + .../rollup.config.js | 31 + .../tsconfig.json | 19 + 14 files changed, 3871 insertions(+) create mode 100644 packages/@azure/cognitiveservices-newssearch/.npmignore create mode 100644 packages/@azure/cognitiveservices-newssearch/LICENSE.txt create mode 100644 packages/@azure/cognitiveservices-newssearch/README.md create mode 100644 packages/@azure/cognitiveservices-newssearch/lib/models/index.ts create mode 100644 packages/@azure/cognitiveservices-newssearch/lib/models/mappers.ts create mode 100644 packages/@azure/cognitiveservices-newssearch/lib/models/newsOperationsMappers.ts create mode 100644 packages/@azure/cognitiveservices-newssearch/lib/models/parameters.ts create mode 100644 packages/@azure/cognitiveservices-newssearch/lib/newsSearchAPIClient.ts create mode 100644 packages/@azure/cognitiveservices-newssearch/lib/newsSearchAPIClientContext.ts create mode 100644 packages/@azure/cognitiveservices-newssearch/lib/operations/index.ts create mode 100644 packages/@azure/cognitiveservices-newssearch/lib/operations/newsOperations.ts create mode 100644 packages/@azure/cognitiveservices-newssearch/package.json create mode 100644 packages/@azure/cognitiveservices-newssearch/rollup.config.js create mode 100644 packages/@azure/cognitiveservices-newssearch/tsconfig.json diff --git a/packages/@azure/cognitiveservices-newssearch/.npmignore b/packages/@azure/cognitiveservices-newssearch/.npmignore new file mode 100644 index 000000000000..a07a455ac10c --- /dev/null +++ b/packages/@azure/cognitiveservices-newssearch/.npmignore @@ -0,0 +1,35 @@ +#git +.git +.gitignore +#gulp +gulpfile.js +#documentation +doc/ +docs/ +#dependencies +node_modules/ +#samples +sample/ +samples/ +#tests +test/ +tests/ +coverage/ +#tools and scripts +tools/ +scripts/ +#IDE settings +*.sln +.vscode/ +.idea +.editorconfig +.ntvs_analysis.* +#build tools +.travis.yml +.jenkins.yml +.codeclimate.yml +appveyor.yml +# Nuget packages # +.nuget/ +packages/ +packages.config diff --git a/packages/@azure/cognitiveservices-newssearch/LICENSE.txt b/packages/@azure/cognitiveservices-newssearch/LICENSE.txt new file mode 100644 index 000000000000..5431ba98b936 --- /dev/null +++ b/packages/@azure/cognitiveservices-newssearch/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/@azure/cognitiveservices-newssearch/README.md b/packages/@azure/cognitiveservices-newssearch/README.md new file mode 100644 index 000000000000..0d944db35cd9 --- /dev/null +++ b/packages/@azure/cognitiveservices-newssearch/README.md @@ -0,0 +1,100 @@ +# An isomorphic javascript sdk for - NewsSearchAPIClient +This project provides an isomorphic javascript package. Right now it supports: +- node.js version 6.x.x or higher +- browser javascript + +## How to Install + +- nodejs +``` +npm install @azure/cognitiveservices-newssearch +``` +- browser +```html + +``` + +## How to use + +### nodejs - Authentication, client creation and search news as an example written in TypeScript. + +```ts +import * as msRest from "ms-rest-js"; +import { NewsSearchAPIClient, NewsSearchAPIModels, NewsSearchAPIMappers } from "@azure/cognitiveservices-newssearch"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +const token = ""; +const creds = new msRest.TokenCredentials(token); +const client = new NewsSearchAPIClient(creds, subscriptionId); +const query = "testquery"; +const acceptLanguage = "testacceptLanguage"; +const userAgent = "testuserAgent"; +const clientId = "testclientId"; +const clientIp = "testclientIp"; +const location = "westus"; +const countryCode = "testcountryCode"; +const count = 1; +const freshness = "Day"; +const market = "testmarket"; +const offset = 1; +const originalImage = true; +const safeSearch = "Off"; +const setLang = "testsetLang"; +const sortBy = "testsortBy"; +const textDecorations = true; +const textFormat = "Raw"; +client.news.search(query, acceptLanguage, userAgent, clientId, clientIp, location, countryCode, count, freshness, market, offset, originalImage, safeSearch, setLang, sortBy, textDecorations, textFormat).then((result) => { + console.log("The result is:"); + console.log(result); +}).catch((err) => { + console.error(err); +}); +``` + +### browser - Authentication, client creation and search news as an example written in javascript. + +- index.html +```html + + + + @azure/cognitiveservices-newssearch sample + + + + + + + +``` + +# Related projects + - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/packages/@azure/cognitiveservices-newssearch/lib/models/index.ts b/packages/@azure/cognitiveservices-newssearch/lib/models/index.ts new file mode 100644 index 000000000000..8822d92886b0 --- /dev/null +++ b/packages/@azure/cognitiveservices-newssearch/lib/models/index.ts @@ -0,0 +1,2312 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { ServiceClientOptions } from "ms-rest-js"; +import * as msRest from "ms-rest-js"; + + +/** + * Contains the possible cases for ResponseBase. + */ +export type ResponseBaseUnion = ResponseBase | IdentifiableUnion; + +/** + * @interface + * An interface representing ResponseBase. + * Response base + * + */ +export interface ResponseBase { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "ResponseBase"; +} + +/** + * Contains the possible cases for Identifiable. + */ +export type IdentifiableUnion = Identifiable | ResponseUnion; + +/** + * @interface + * An interface representing Identifiable. + * Defines the identity of a resource. + * + */ +export interface Identifiable { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "Identifiable"; + /** + * @member {string} [id] A String identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; +} + +/** + * Contains the possible cases for Response. + */ +export type ResponseUnion = Response | AnswerUnion | ThingUnion | ErrorResponse; + +/** + * @interface + * An interface representing Response. + * Defines a response. All schemas that could be returned at the root of a + * response should inherit from this + * + */ +export interface Response { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "Response"; + /** + * @member {string} [id] A String identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [webSearchUrl] The URL To Bing's search result for this + * item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly webSearchUrl?: string; +} + +/** + * Contains the possible cases for Thing. + */ +export type ThingUnion = Thing | NewsTopic | CreativeWorkUnion | Organization; + +/** + * @interface + * An interface representing Thing. + * Defines a thing. + * + */ +export interface Thing { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "Thing"; + /** + * @member {string} [id] A String identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [webSearchUrl] The URL To Bing's search result for this + * item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly webSearchUrl?: string; + /** + * @member {string} [name] The name of the thing represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [url] The URL to get more information about the thing + * represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly url?: string; + /** + * @member {ImageObject} [image] An image of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly image?: ImageObject; + /** + * @member {string} [description] A short description of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly description?: string; + /** + * @member {string} [alternateName] An alias for the item + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly alternateName?: string; + /** + * @member {string} [bingId] An ID that uniquely identifies this item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly bingId?: string; +} + +/** + * Contains the possible cases for CreativeWork. + */ +export type CreativeWorkUnion = CreativeWork | ArticleUnion | MediaObjectUnion; + +/** + * @interface + * An interface representing CreativeWork. + * The most generic kind of creative work, including books, movies, + * photographs, software programs, etc. + * + */ +export interface CreativeWork { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "CreativeWork"; + /** + * @member {string} [id] A String identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [webSearchUrl] The URL To Bing's search result for this + * item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly webSearchUrl?: string; + /** + * @member {string} [name] The name of the thing represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [url] The URL to get more information about the thing + * represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly url?: string; + /** + * @member {ImageObject} [image] An image of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly image?: ImageObject; + /** + * @member {string} [description] A short description of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly description?: string; + /** + * @member {string} [alternateName] An alias for the item + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly alternateName?: string; + /** + * @member {string} [bingId] An ID that uniquely identifies this item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly bingId?: string; + /** + * @member {string} [thumbnailUrl] The URL to a thumbnail of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly thumbnailUrl?: string; + /** + * @member {ThingUnion[]} [provider] The source of the creative work. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provider?: ThingUnion[]; + /** + * @member {string} [datePublished] The date on which the CreativeWork was + * published. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly datePublished?: string; + /** + * @member {VideoObject} [video] A video of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly video?: VideoObject; +} + +/** + * Contains the possible cases for Article. + */ +export type ArticleUnion = Article | NewsArticle; + +/** + * @interface + * An interface representing Article. + */ +export interface Article { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "Article"; + /** + * @member {string} [id] A String identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [webSearchUrl] The URL To Bing's search result for this + * item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly webSearchUrl?: string; + /** + * @member {string} [name] The name of the thing represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [url] The URL to get more information about the thing + * represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly url?: string; + /** + * @member {ImageObject} [image] An image of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly image?: ImageObject; + /** + * @member {string} [description] A short description of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly description?: string; + /** + * @member {string} [alternateName] An alias for the item + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly alternateName?: string; + /** + * @member {string} [bingId] An ID that uniquely identifies this item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly bingId?: string; + /** + * @member {string} [thumbnailUrl] The URL to a thumbnail of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly thumbnailUrl?: string; + /** + * @member {ThingUnion[]} [provider] The source of the creative work. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provider?: ThingUnion[]; + /** + * @member {string} [datePublished] The date on which the CreativeWork was + * published. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly datePublished?: string; + /** + * @member {VideoObject} [video] A video of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly video?: VideoObject; + /** + * @member {number} [wordCount] The number of words in the text of the + * Article. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly wordCount?: number; +} + +/** + * @interface + * An interface representing NewsArticle. + * Defines a news article. + * + */ +export interface NewsArticle { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "NewsArticle"; + /** + * @member {string} [id] A String identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [webSearchUrl] The URL To Bing's search result for this + * item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly webSearchUrl?: string; + /** + * @member {string} [name] The name of the thing represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [url] The URL to get more information about the thing + * represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly url?: string; + /** + * @member {ImageObject} [image] An image of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly image?: ImageObject; + /** + * @member {string} [description] A short description of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly description?: string; + /** + * @member {string} [alternateName] An alias for the item + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly alternateName?: string; + /** + * @member {string} [bingId] An ID that uniquely identifies this item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly bingId?: string; + /** + * @member {string} [thumbnailUrl] The URL to a thumbnail of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly thumbnailUrl?: string; + /** + * @member {ThingUnion[]} [provider] The source of the creative work. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provider?: ThingUnion[]; + /** + * @member {string} [datePublished] The date on which the CreativeWork was + * published. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly datePublished?: string; + /** + * @member {VideoObject} [video] A video of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly video?: VideoObject; + /** + * @member {number} [wordCount] The number of words in the text of the + * Article. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly wordCount?: number; + /** + * @member {string} [category] The news category that the article belongs to. + * For example, Sports. If the news category cannot be determined, the + * article does not include this field. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly category?: string; + /** + * @member {boolean} [headline] A Boolean value that indicates whether the + * news article is a headline. If true, the article is a headline. The + * article includes this field only for news categories requests that do not + * specify the category query parameter. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly headline?: boolean; + /** + * @member {NewsArticle[]} [clusteredArticles] A list of related news + * articles. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly clusteredArticles?: NewsArticle[]; +} + +/** + * Contains the possible cases for Answer. + */ +export type AnswerUnion = Answer | SearchResultsAnswerUnion | TrendingTopics; + +/** + * @interface + * An interface representing Answer. + * Defines an answer. + * + */ +export interface Answer { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "Answer"; + /** + * @member {string} [id] A String identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [webSearchUrl] The URL To Bing's search result for this + * item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly webSearchUrl?: string; + /** + * @member {Query[]} [followUpQueries] **NOTE: This property will not be + * serialized. It can only be populated by the server.** + */ + readonly followUpQueries?: Query[]; +} + +/** + * Contains the possible cases for SearchResultsAnswer. + */ +export type SearchResultsAnswerUnion = SearchResultsAnswer | News; + +/** + * @interface + * An interface representing SearchResultsAnswer. + * Defines a search result answer. + * + */ +export interface SearchResultsAnswer { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "SearchResultsAnswer"; + /** + * @member {string} [id] A String identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [webSearchUrl] The URL To Bing's search result for this + * item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly webSearchUrl?: string; + /** + * @member {Query[]} [followUpQueries] **NOTE: This property will not be + * serialized. It can only be populated by the server.** + */ + readonly followUpQueries?: Query[]; + /** + * @member {number} [totalEstimatedMatches] The estimated number of webpages + * that are relevant to the query. Use this number along with the count and + * offset query parameters to page the results. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly totalEstimatedMatches?: number; +} + +/** + * @interface + * An interface representing News. + * Defines a news answer. + * + */ +export interface News { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "News"; + /** + * @member {string} [id] A String identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [webSearchUrl] The URL To Bing's search result for this + * item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly webSearchUrl?: string; + /** + * @member {Query[]} [followUpQueries] **NOTE: This property will not be + * serialized. It can only be populated by the server.** + */ + readonly followUpQueries?: Query[]; + /** + * @member {number} [totalEstimatedMatches] The estimated number of webpages + * that are relevant to the query. Use this number along with the count and + * offset query parameters to page the results. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly totalEstimatedMatches?: number; + /** + * @member {NewsArticle[]} value An array of NewsArticle objects that contain + * information about news articles that are relevant to the query. If there + * are no results to return for the request, the array is empty. + */ + value: NewsArticle[]; + /** + * @member {string} [location] Location of local news + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly location?: string; +} + +/** + * Contains the possible cases for MediaObject. + */ +export type MediaObjectUnion = MediaObject | ImageObject | VideoObject; + +/** + * @interface + * An interface representing MediaObject. + * Defines a media object. + * + */ +export interface MediaObject { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "MediaObject"; + /** + * @member {string} [id] A String identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [webSearchUrl] The URL To Bing's search result for this + * item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly webSearchUrl?: string; + /** + * @member {string} [name] The name of the thing represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [url] The URL to get more information about the thing + * represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly url?: string; + /** + * @member {ImageObject} [image] An image of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly image?: ImageObject; + /** + * @member {string} [description] A short description of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly description?: string; + /** + * @member {string} [alternateName] An alias for the item + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly alternateName?: string; + /** + * @member {string} [bingId] An ID that uniquely identifies this item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly bingId?: string; + /** + * @member {string} [thumbnailUrl] The URL to a thumbnail of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly thumbnailUrl?: string; + /** + * @member {ThingUnion[]} [provider] The source of the creative work. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provider?: ThingUnion[]; + /** + * @member {string} [datePublished] The date on which the CreativeWork was + * published. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly datePublished?: string; + /** + * @member {VideoObject} [video] A video of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly video?: VideoObject; + /** + * @member {string} [contentUrl] Original URL to retrieve the source (file) + * for the media object (e.g the source URL for the image). + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly contentUrl?: string; + /** + * @member {number} [width] The width of the source media object, in pixels. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly width?: number; + /** + * @member {number} [height] The height of the source media object, in + * pixels. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly height?: number; +} + +/** + * @interface + * An interface representing ImageObject. + * Defines an image + * + */ +export interface ImageObject { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "ImageObject"; + /** + * @member {string} [id] A String identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [webSearchUrl] The URL To Bing's search result for this + * item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly webSearchUrl?: string; + /** + * @member {string} [name] The name of the thing represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [url] The URL to get more information about the thing + * represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly url?: string; + /** + * @member {ImageObject} [image] An image of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly image?: ImageObject; + /** + * @member {string} [description] A short description of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly description?: string; + /** + * @member {string} [alternateName] An alias for the item + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly alternateName?: string; + /** + * @member {string} [bingId] An ID that uniquely identifies this item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly bingId?: string; + /** + * @member {string} [thumbnailUrl] The URL to a thumbnail of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly thumbnailUrl?: string; + /** + * @member {ThingUnion[]} [provider] The source of the creative work. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provider?: ThingUnion[]; + /** + * @member {string} [datePublished] The date on which the CreativeWork was + * published. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly datePublished?: string; + /** + * @member {VideoObject} [video] A video of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly video?: VideoObject; + /** + * @member {string} [contentUrl] Original URL to retrieve the source (file) + * for the media object (e.g the source URL for the image). + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly contentUrl?: string; + /** + * @member {number} [width] The width of the source media object, in pixels. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly width?: number; + /** + * @member {number} [height] The height of the source media object, in + * pixels. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly height?: number; + /** + * @member {ImageObject} [thumbnail] The URL to a thumbnail of the image + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly thumbnail?: ImageObject; +} + +/** + * @interface + * An interface representing Query. + * Defines a search query. + * + */ +export interface Query { + /** + * @member {string} text The query string. Use this string as the query term + * in a new search request. + */ + text: string; + /** + * @member {string} [displayText] The display version of the query term. This + * version of the query term may contain special characters that highlight + * the search term found in the query string. The string contains the + * highlighting characters only if the query enabled hit highlighting + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly displayText?: string; + /** + * @member {string} [webSearchUrl] The URL that takes the user to the Bing + * search results page for the query.Only related search results include this + * field. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly webSearchUrl?: string; + /** + * @member {string} [searchLink] The URL that you use to get the results of + * the related search. Before using the URL, you must append query parameters + * as appropriate and include the Ocp-Apim-Subscription-Key header. Use this + * URL if you're displaying the results in your own user interface. + * Otherwise, use the webSearchUrl URL. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly searchLink?: string; + /** + * @member {ImageObject} [thumbnail] The URL to a thumbnail of a related + * image. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly thumbnail?: ImageObject; +} + +/** + * @interface + * An interface representing NewsTopic. + */ +export interface NewsTopic { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "News/Topic"; + /** + * @member {string} [id] A String identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [webSearchUrl] The URL To Bing's search result for this + * item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly webSearchUrl?: string; + /** + * @member {string} [name] The name of the thing represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [url] The URL to get more information about the thing + * represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly url?: string; + /** + * @member {ImageObject} [image] An image of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly image?: ImageObject; + /** + * @member {string} [description] A short description of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly description?: string; + /** + * @member {string} [alternateName] An alias for the item + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly alternateName?: string; + /** + * @member {string} [bingId] An ID that uniquely identifies this item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly bingId?: string; + /** + * @member {boolean} [isBreakingNews] A Boolean value that indicates whether + * the topic is considered breaking news. If the topic is considered breaking + * news, the value is true. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly isBreakingNews?: boolean; + /** + * @member {Query} [query] A search query term that returns this trending + * topic. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly query?: Query; + /** + * @member {string} [newsSearchUrl] The URL to the Bing News search results + * for the search query term + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly newsSearchUrl?: string; +} + +/** + * @interface + * An interface representing TrendingTopics. + */ +export interface TrendingTopics { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "TrendingTopics"; + /** + * @member {string} [id] A String identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [webSearchUrl] The URL To Bing's search result for this + * item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly webSearchUrl?: string; + /** + * @member {Query[]} [followUpQueries] **NOTE: This property will not be + * serialized. It can only be populated by the server.** + */ + readonly followUpQueries?: Query[]; + /** + * @member {NewsTopic[]} value A list of trending news topics on Bing + */ + value: NewsTopic[]; +} + +/** + * @interface + * An interface representing VideoObject. + * Defines a video object that is relevant to the query. + * + */ +export interface VideoObject { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "VideoObject"; + /** + * @member {string} [id] A String identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [webSearchUrl] The URL To Bing's search result for this + * item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly webSearchUrl?: string; + /** + * @member {string} [name] The name of the thing represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [url] The URL to get more information about the thing + * represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly url?: string; + /** + * @member {ImageObject} [image] An image of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly image?: ImageObject; + /** + * @member {string} [description] A short description of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly description?: string; + /** + * @member {string} [alternateName] An alias for the item + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly alternateName?: string; + /** + * @member {string} [bingId] An ID that uniquely identifies this item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly bingId?: string; + /** + * @member {string} [thumbnailUrl] The URL to a thumbnail of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly thumbnailUrl?: string; + /** + * @member {ThingUnion[]} [provider] The source of the creative work. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provider?: ThingUnion[]; + /** + * @member {string} [datePublished] The date on which the CreativeWork was + * published. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly datePublished?: string; + /** + * @member {VideoObject} [video] A video of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly video?: VideoObject; + /** + * @member {string} [contentUrl] Original URL to retrieve the source (file) + * for the media object (e.g the source URL for the image). + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly contentUrl?: string; + /** + * @member {number} [width] The width of the source media object, in pixels. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly width?: number; + /** + * @member {number} [height] The height of the source media object, in + * pixels. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly height?: number; + /** + * @member {string} [motionThumbnailUrl] **NOTE: This property will not be + * serialized. It can only be populated by the server.** + */ + readonly motionThumbnailUrl?: string; + /** + * @member {string} [motionThumbnailId] **NOTE: This property will not be + * serialized. It can only be populated by the server.** + */ + readonly motionThumbnailId?: string; + /** + * @member {string} [embedHtml] **NOTE: This property will not be serialized. + * It can only be populated by the server.** + */ + readonly embedHtml?: string; + /** + * @member {boolean} [allowHttpsEmbed] **NOTE: This property will not be + * serialized. It can only be populated by the server.** + */ + readonly allowHttpsEmbed?: boolean; + /** + * @member {number} [viewCount] **NOTE: This property will not be serialized. + * It can only be populated by the server.** + */ + readonly viewCount?: number; + /** + * @member {ImageObject} [thumbnail] **NOTE: This property will not be + * serialized. It can only be populated by the server.** + */ + readonly thumbnail?: ImageObject; + /** + * @member {string} [videoId] **NOTE: This property will not be serialized. + * It can only be populated by the server.** + */ + readonly videoId?: string; + /** + * @member {boolean} [allowMobileEmbed] **NOTE: This property will not be + * serialized. It can only be populated by the server.** + */ + readonly allowMobileEmbed?: boolean; + /** + * @member {boolean} [isSuperfresh] **NOTE: This property will not be + * serialized. It can only be populated by the server.** + */ + readonly isSuperfresh?: boolean; +} + +/** + * @interface + * An interface representing Organization. + * Defines an organization. + * + */ +export interface Organization { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "Organization"; + /** + * @member {string} [id] A String identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [webSearchUrl] The URL To Bing's search result for this + * item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly webSearchUrl?: string; + /** + * @member {string} [name] The name of the thing represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [url] The URL to get more information about the thing + * represented by this object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly url?: string; + /** + * @member {ImageObject} [image] An image of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly image?: ImageObject; + /** + * @member {string} [description] A short description of the item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly description?: string; + /** + * @member {string} [alternateName] An alias for the item + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly alternateName?: string; + /** + * @member {string} [bingId] An ID that uniquely identifies this item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly bingId?: string; +} + +/** + * @interface + * An interface representing ErrorModel. + * Defines the error that occurred. + * + */ +export interface ErrorModel { + /** + * @member {ErrorCode} code The error code that identifies the category of + * error. Possible values include: 'None', 'ServerError', 'InvalidRequest', + * 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. + * Default value: 'None' . + */ + code: ErrorCode; + /** + * @member {ErrorSubCode} [subCode] The error code that further helps to + * identify the error. Possible values include: 'UnexpectedError', + * 'ResourceError', 'NotImplemented', 'ParameterMissing', + * 'ParameterInvalidValue', 'HttpNotAllowed', 'Blocked', + * 'AuthorizationMissing', 'AuthorizationRedundancy', + * 'AuthorizationDisabled', 'AuthorizationExpired' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly subCode?: ErrorSubCode; + /** + * @member {string} message A description of the error. + */ + message: string; + /** + * @member {string} [moreDetails] A description that provides additional + * information about the error. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly moreDetails?: string; + /** + * @member {string} [parameter] The parameter in the request that caused the + * error. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly parameter?: string; + /** + * @member {string} [value] The parameter's value in the request that was not + * valid. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly value?: string; +} + +/** + * @interface + * An interface representing ErrorResponse. + * The top-level response that represents a failed request. + * + */ +export interface ErrorResponse { + /** + * @member {string} _type Polymorphic Discriminator + */ + _type: "ErrorResponse"; + /** + * @member {string} [id] A String identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [webSearchUrl] The URL To Bing's search result for this + * item. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly webSearchUrl?: string; + /** + * @member {ErrorModel[]} errors A list of errors that describe the reasons + * why the request failed. + */ + errors: ErrorModel[]; +} + +/** + * @interface + * An interface representing NewsSearchAPIClientOptions. + * @extends ServiceClientOptions + */ +export interface NewsSearchAPIClientOptions extends ServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + +/** + * @interface + * An interface representing NewsSearchOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface NewsSearchOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [acceptLanguage] A comma-delimited list of one or more + * languages to use for user interface strings. The list is in decreasing + * order of preference. For additional information, including expected + * format, see + * [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This + * header and the + * [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#setlang) + * query parameter are mutually exclusive; do not specify both. If you set + * this header, you must also specify the + * [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#cc) + * query parameter. To determine the market to return results for, Bing uses + * the first supported language it finds from the list and combines it with + * the cc parameter value. If the list does not include a supported language, + * Bing finds the closest language and market that supports the request or it + * uses an aggregated or default market for the results. To determine the + * market that Bing used, see the BingAPIs-Market header. Use this header and + * the cc query parameter only if you specify multiple languages. Otherwise, + * use the + * [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#mkt) + * and + * [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#setlang) + * query parameters. A user interface string is a string that's used as a + * label in a user interface. There are few user interface strings in the + * JSON response objects. Any links to Bing.com properties in the response + * objects apply the specified language. + */ + acceptLanguage?: string; + /** + * @member {string} [userAgent] The user agent originating the request. Bing + * uses the user agent to provide mobile users with an optimized experience. + * Although optional, you are encouraged to always specify this header. The + * user-agent should be the same string that any commonly used browser sends. + * For information about user agents, see [RFC + * 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). The + * following are examples of user-agent strings. Windows Phone: Mozilla/5.0 + * (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; + * ARM; Touch; NOKIA; Lumia 822). Android: Mozilla / 5.0 (Linux; U; Android + * 2.3.5; en - us; SCH - I500 Build / GINGERBREAD) AppleWebKit / 533.1 + * (KHTML; like Gecko) Version / 4.0 Mobile Safari / 533.1. iPhone: Mozilla / + * 5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit / 536.26 (KHTML; + * like Gecko) Mobile / 10B142 iPhone4; 1 BingWeb / 3.03.1428.20120423. PC: + * Mozilla / 5.0 (Windows NT 6.3; WOW64; Trident / 7.0; Touch; rv:11.0) like + * Gecko. iPad: Mozilla / 5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit / + * 537.51.1 (KHTML, like Gecko) Version / 7.0 Mobile / 11A465 Safari / + * 9537.53 + */ + userAgent?: string; + /** + * @member {string} [clientId] Bing uses this header to provide users with + * consistent behavior across Bing API calls. Bing often flights new features + * and improvements, and it uses the client ID as a key for assigning traffic + * on different flights. If you do not use the same client ID for a user + * across multiple requests, then Bing may assign the user to multiple + * conflicting flights. Being assigned to multiple conflicting flights can + * lead to an inconsistent user experience. For example, if the second + * request has a different flight assignment than the first, the experience + * may be unexpected. Also, Bing can use the client ID to tailor web results + * to that client ID’s search history, providing a richer experience for the + * user. Bing also uses this header to help improve result rankings by + * analyzing the activity generated by a client ID. The relevance + * improvements help with better quality of results delivered by Bing APIs + * and in turn enables higher click-through rates for the API consumer. + * IMPORTANT: Although optional, you should consider this header required. + * Persisting the client ID across multiple requests for the same end user + * and device combination enables 1) the API consumer to receive a consistent + * user experience, and 2) higher click-through rates via better quality of + * results from the Bing APIs. Each user that uses your application on the + * device must have a unique, Bing generated client ID. If you do not include + * this header in the request, Bing generates an ID and returns it in the + * X-MSEdge-ClientID response header. The only time that you should NOT + * include this header in a request is the first time the user uses your app + * on that device. Use the client ID for each Bing API request that your app + * makes for this user on the device. Persist the client ID. To persist the + * ID in a browser app, use a persistent HTTP cookie to ensure the ID is used + * across all sessions. Do not use a session cookie. For other apps such as + * mobile apps, use the device's persistent storage to persist the ID. The + * next time the user uses your app on that device, get the client ID that + * you persisted. Bing responses may or may not include this header. If the + * response includes this header, capture the client ID and use it for all + * subsequent Bing requests for the user on that device. If you include the + * X-MSEdge-ClientID, you must not include cookies in the request. + */ + clientId?: string; + /** + * @member {string} [clientIp] The IPv4 or IPv6 address of the client device. + * The IP address is used to discover the user's location. Bing uses the + * location information to determine safe search behavior. Although optional, + * you are encouraged to always specify this header and the X-Search-Location + * header. Do not obfuscate the address (for example, by changing the last + * octet to 0). Obfuscating the address results in the location not being + * anywhere near the device's actual location, which may result in Bing + * serving erroneous results. + */ + clientIp?: string; + /** + * @member {string} [location] A semicolon-delimited list of key/value pairs + * that describe the client's geographical location. Bing uses the location + * information to determine safe search behavior and to return relevant local + * content. Specify the key/value pair as :. The following are + * the keys that you use to specify the user's location. lat (required): The + * latitude of the client's location, in degrees. The latitude must be + * greater than or equal to -90.0 and less than or equal to +90.0. Negative + * values indicate southern latitudes and positive values indicate northern + * latitudes. long (required): The longitude of the client's location, in + * degrees. The longitude must be greater than or equal to -180.0 and less + * than or equal to +180.0. Negative values indicate western longitudes and + * positive values indicate eastern longitudes. re (required): The radius, in + * meters, which specifies the horizontal accuracy of the coordinates. Pass + * the value returned by the device's location service. Typical values might + * be 22m for GPS/Wi-Fi, 380m for cell tower triangulation, and 18,000m for + * reverse IP lookup. ts (optional): The UTC UNIX timestamp of when the + * client was at the location. (The UNIX timestamp is the number of seconds + * since January 1, 1970.) head (optional): The client's relative heading or + * direction of travel. Specify the direction of travel as degrees from 0 + * through 360, counting clockwise relative to true north. Specify this key + * only if the sp key is nonzero. sp (optional): The horizontal velocity + * (speed), in meters per second, that the client device is traveling. alt + * (optional): The altitude of the client device, in meters. are (optional): + * The radius, in meters, that specifies the vertical accuracy of the + * coordinates. Specify this key only if you specify the alt key. Although + * many of the keys are optional, the more information that you provide, the + * more accurate the location results are. Although optional, you are + * encouraged to always specify the user's geographical location. Providing + * the location is especially important if the client's IP address does not + * accurately reflect the user's physical location (for example, if the + * client uses VPN). For optimal results, you should include this header and + * the X-MSEdge-ClientIP header, but at a minimum, you should include this + * header. + */ + location?: string; + /** + * @member {string} [countryCode] A 2-character country code of the country + * where the results come from. This API supports only the United States + * market. If you specify this query parameter, it must be set to us. If you + * set this parameter, you must also specify the Accept-Language header. Bing + * uses the first supported language it finds from the languages list, and + * combine that language with the country code that you specify to determine + * the market to return results for. If the languages list does not include a + * supported language, Bing finds the closest language and market that + * supports the request, or it may use an aggregated or default market for + * the results instead of a specified one. You should use this query + * parameter and the Accept-Language query parameter only if you specify + * multiple languages; otherwise, you should use the mkt and setLang query + * parameters. This parameter and the mkt query parameter are mutually + * exclusive—do not specify both. + */ + countryCode?: string; + /** + * @member {number} [count] The number of news articles to return in the + * response. The actual number delivered may be less than requested. The + * default is 10 and the maximum value is 100. The actual number delivered + * may be less than requested.You may use this parameter along with the + * offset parameter to page results. For example, if your user interface + * displays 20 articles per page, set count to 20 and offset to 0 to get the + * first page of results. For each subsequent page, increment offset by 20 + * (for example, 0, 20, 40). It is possible for multiple pages to include + * some overlap in results. + */ + count?: number; + /** + * @member {Freshness} [freshness] Filter news by the date and time that Bing + * discovered the news. The following are the possible filter values. Day: + * Return news discovered within the last 24 hours. Week: Return news + * discovered within the last 7 days. Month: Return news discovered within + * the last 30 days. Use this parameter only with the News Search API. Do not + * specify this parameter when calling the News Category API or the Trending + * Topics API. Possible values include: 'Day', 'Week', 'Month' + */ + freshness?: Freshness; + /** + * @member {string} [market] The market where the results come from. + * Typically, mkt is the country where the user is making the request from. + * However, it could be a different country if the user is not located in a + * country where Bing delivers results. The market must be in the form + * -. For example, en-US. The string is case + * insensitive. For a list of possible market values, see [Market + * Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#market-codes). + * NOTE: If known, you are encouraged to always specify the market. + * Specifying the market helps Bing route the request and return an + * appropriate and optimal response. If you specify a market that is not + * listed in [Market + * Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#market-codes), + * Bing uses a best fit market code based on an internal mapping that is + * subject to change. This parameter and the + * [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#cc) + * query parameter are mutually exclusive—do not specify both. + */ + market?: string; + /** + * @member {number} [offset] The zero-based offset that indicates the number + * of news to skip before returning news. The default is 0. The offset should + * be less than + * ([totalEstimatedMatches](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#news-totalmatches) + * - count). Use this parameter along with the count parameter to page + * results. For example, if your user interface displays 20 news per page, + * set count to 20 and offset to 0 to get the first page of results. For each + * subsequent page, increment offset by 20 (for example, 0, 20, 40). It is + * possible for multiple pages to include some overlap in results. + */ + offset?: number; + /** + * @member {boolean} [originalImage] A Boolean value that determines whether + * the image's contentUrl contains a URL that points to a thumbnail of the + * original article's image or the image itself. If the article includes an + * image, and this parameter is set to true, the image's contentUrl property + * contains a URL that you may use to download the original image from the + * publisher's website. Otherwise, if this parameter is false, the image's + * contentUrl and thumbnailUrl URLs both point to the same thumbnail image. + * Use this parameter only with the News Search API. Do not specify this + * parameter when calling the Trending Topics API or News Category API. + */ + originalImage?: boolean; + /** + * @member {SafeSearch} [safeSearch] Filter news for adult content. The + * following are the possible filter values. Off: Return news articles with + * adult text, images, or videos. Moderate: Return news articles with adult + * text but not adult images or videos. Strict: Do not return news articles + * with adult text, images, or videos. If the request comes from a market + * that Bing's adult policy requires that safeSearch is set to Strict, Bing + * ignores the safeSearch value and uses Strict. If you use the site: query + * operator, there is the chance that the response may contain adult content + * regardless of what the safeSearch query parameter is set to. Use site: + * only if you are aware of the content on the site and your scenario + * supports the possibility of adult content. Possible values include: 'Off', + * 'Moderate', 'Strict' + */ + safeSearch?: SafeSearch; + /** + * @member {string} [setLang] The language to use for user interface strings. + * Specify the language using the ISO 639-1 2-letter language code. For + * example, the language code for English is EN. The default is EN (English). + * Although optional, you should always specify the language. Typically, you + * set setLang to the same language specified by mkt unless the user wants + * the user interface strings displayed in a different language. This + * parameter and the + * [Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#acceptlanguage) + * header are mutually exclusive; do not specify both. A user interface + * string is a string that's used as a label in a user interface. There are + * few user interface strings in the JSON response objects. Also, any links + * to Bing.com properties in the response objects apply the specified + * language. + */ + setLang?: string; + /** + * @member {string} [sortBy] The order to return the news in. The following + * are the possible case-insensitive values. Date: If the request is through + * the News Search API, the response returns news articles sorted by date + * from the most recent to the oldest. If the request is through the News + * Trending Topics API, the response returns trending topics sorted by date + * from the most recent to the oldest. + */ + sortBy?: string; + /** + * @member {boolean} [textDecorations] A Boolean value that determines + * whether display strings contain decoration markers such as hit + * highlighting characters. If true, the strings may include markers. The + * default is false. To specify whether to use Unicode characters or HTML + * tags as the markers, see the + * [textFormat](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#textformat) + * query parameter. For information about hit highlighting, see [Hit + * Highlighting](https://docs.microsoft.com/azure/cognitive-services/bing-news-search/hit-highlighting). + */ + textDecorations?: boolean; + /** + * @member {TextFormat} [textFormat] The type of markers to use for text + * decorations (see the textDecorations query parameter). Possible values are + * Raw—Use Unicode characters to mark content that needs special formatting. + * The Unicode characters are in the range E000 through E019. For example, + * Bing uses E000 and E001 to mark the beginning and end of query terms for + * hit highlighting. HTML—Use HTML tags to mark content that needs special + * formatting. For example, use tags to highlight query terms in display + * strings. The default is Raw. For display strings that contain escapable + * HTML characters such as <, >, and &, if textFormat is set to HTML, Bing + * escapes the characters as appropriate (for example, < is escaped to <). + * Possible values include: 'Raw', 'Html' + */ + textFormat?: TextFormat; +} + +/** + * @interface + * An interface representing NewsCategoryOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface NewsCategoryOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [acceptLanguage] A comma-delimited list of one or more + * languages to use for user interface strings. The list is in decreasing + * order of preference. For additional information, including expected + * format, see + * [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This + * header and the + * [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#setlang) + * query parameter are mutually exclusive; do not specify both. If you set + * this header, you must also specify the + * [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#cc) + * query parameter. To determine the market to return results for, Bing uses + * the first supported language it finds from the list and combines it with + * the cc parameter value. If the list does not include a supported language, + * Bing finds the closest language and market that supports the request or it + * uses an aggregated or default market for the results. To determine the + * market that Bing used, see the BingAPIs-Market header. Use this header and + * the cc query parameter only if you specify multiple languages. Otherwise, + * use the + * [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#mkt) + * and + * [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#setlang) + * query parameters. A user interface string is a string that's used as a + * label in a user interface. There are few user interface strings in the + * JSON response objects. Any links to Bing.com properties in the response + * objects apply the specified language. + */ + acceptLanguage?: string; + /** + * @member {string} [userAgent] The user agent originating the request. Bing + * uses the user agent to provide mobile users with an optimized experience. + * Although optional, you are encouraged to always specify this header. The + * user-agent should be the same string that any commonly used browser sends. + * For information about user agents, see [RFC + * 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). The + * following are examples of user-agent strings. Windows Phone: Mozilla/5.0 + * (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; + * ARM; Touch; NOKIA; Lumia 822). Android: Mozilla / 5.0 (Linux; U; Android + * 2.3.5; en - us; SCH - I500 Build / GINGERBREAD) AppleWebKit / 533.1 + * (KHTML; like Gecko) Version / 4.0 Mobile Safari / 533.1. iPhone: Mozilla / + * 5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit / 536.26 (KHTML; + * like Gecko) Mobile / 10B142 iPhone4; 1 BingWeb / 3.03.1428.20120423. PC: + * Mozilla / 5.0 (Windows NT 6.3; WOW64; Trident / 7.0; Touch; rv:11.0) like + * Gecko. iPad: Mozilla / 5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit / + * 537.51.1 (KHTML, like Gecko) Version / 7.0 Mobile / 11A465 Safari / + * 9537.53 + */ + userAgent?: string; + /** + * @member {string} [clientId] Bing uses this header to provide users with + * consistent behavior across Bing API calls. Bing often flights new features + * and improvements, and it uses the client ID as a key for assigning traffic + * on different flights. If you do not use the same client ID for a user + * across multiple requests, then Bing may assign the user to multiple + * conflicting flights. Being assigned to multiple conflicting flights can + * lead to an inconsistent user experience. For example, if the second + * request has a different flight assignment than the first, the experience + * may be unexpected. Also, Bing can use the client ID to tailor web results + * to that client ID’s search history, providing a richer experience for the + * user. Bing also uses this header to help improve result rankings by + * analyzing the activity generated by a client ID. The relevance + * improvements help with better quality of results delivered by Bing APIs + * and in turn enables higher click-through rates for the API consumer. + * IMPORTANT: Although optional, you should consider this header required. + * Persisting the client ID across multiple requests for the same end user + * and device combination enables 1) the API consumer to receive a consistent + * user experience, and 2) higher click-through rates via better quality of + * results from the Bing APIs. Each user that uses your application on the + * device must have a unique, Bing generated client ID. If you do not include + * this header in the request, Bing generates an ID and returns it in the + * X-MSEdge-ClientID response header. The only time that you should NOT + * include this header in a request is the first time the user uses your app + * on that device. Use the client ID for each Bing API request that your app + * makes for this user on the device. Persist the client ID. To persist the + * ID in a browser app, use a persistent HTTP cookie to ensure the ID is used + * across all sessions. Do not use a session cookie. For other apps such as + * mobile apps, use the device's persistent storage to persist the ID. The + * next time the user uses your app on that device, get the client ID that + * you persisted. Bing responses may or may not include this header. If the + * response includes this header, capture the client ID and use it for all + * subsequent Bing requests for the user on that device. If you include the + * X-MSEdge-ClientID, you must not include cookies in the request. + */ + clientId?: string; + /** + * @member {string} [clientIp] The IPv4 or IPv6 address of the client device. + * The IP address is used to discover the user's location. Bing uses the + * location information to determine safe search behavior. Although optional, + * you are encouraged to always specify this header and the X-Search-Location + * header. Do not obfuscate the address (for example, by changing the last + * octet to 0). Obfuscating the address results in the location not being + * anywhere near the device's actual location, which may result in Bing + * serving erroneous results. + */ + clientIp?: string; + /** + * @member {string} [location] A semicolon-delimited list of key/value pairs + * that describe the client's geographical location. Bing uses the location + * information to determine safe search behavior and to return relevant local + * content. Specify the key/value pair as :. The following are + * the keys that you use to specify the user's location. lat (required): The + * latitude of the client's location, in degrees. The latitude must be + * greater than or equal to -90.0 and less than or equal to +90.0. Negative + * values indicate southern latitudes and positive values indicate northern + * latitudes. long (required): The longitude of the client's location, in + * degrees. The longitude must be greater than or equal to -180.0 and less + * than or equal to +180.0. Negative values indicate western longitudes and + * positive values indicate eastern longitudes. re (required): The radius, in + * meters, which specifies the horizontal accuracy of the coordinates. Pass + * the value returned by the device's location service. Typical values might + * be 22m for GPS/Wi-Fi, 380m for cell tower triangulation, and 18,000m for + * reverse IP lookup. ts (optional): The UTC UNIX timestamp of when the + * client was at the location. (The UNIX timestamp is the number of seconds + * since January 1, 1970.) head (optional): The client's relative heading or + * direction of travel. Specify the direction of travel as degrees from 0 + * through 360, counting clockwise relative to true north. Specify this key + * only if the sp key is nonzero. sp (optional): The horizontal velocity + * (speed), in meters per second, that the client device is traveling. alt + * (optional): The altitude of the client device, in meters. are (optional): + * The radius, in meters, that specifies the vertical accuracy of the + * coordinates. Specify this key only if you specify the alt key. Although + * many of the keys are optional, the more information that you provide, the + * more accurate the location results are. Although optional, you are + * encouraged to always specify the user's geographical location. Providing + * the location is especially important if the client's IP address does not + * accurately reflect the user's physical location (for example, if the + * client uses VPN). For optimal results, you should include this header and + * the X-MSEdge-ClientIP header, but at a minimum, you should include this + * header. + */ + location?: string; + /** + * @member {string} [countryCode] A 2-character country code of the country + * where the results come from. This API supports only the United States + * market. If you specify this query parameter, it must be set to us. If you + * set this parameter, you must also specify the Accept-Language header. Bing + * uses the first supported language it finds from the languages list, and + * combine that language with the country code that you specify to determine + * the market to return results for. If the languages list does not include a + * supported language, Bing finds the closest language and market that + * supports the request, or it may use an aggregated or default market for + * the results instead of a specified one. You should use this query + * parameter and the Accept-Language query parameter only if you specify + * multiple languages; otherwise, you should use the mkt and setLang query + * parameters. This parameter and the mkt query parameter are mutually + * exclusive—do not specify both. + */ + countryCode?: string; + /** + * @member {string} [category] The category of articles to return. For + * example, Sports articles or Entertainment articles. For a list of possible + * categories, see [News Categories by + * Market](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#categories-by-market). + * Use this parameter only with News Category API. If you do not specify this + * parameter, the response includes both: Headline articles typically + * published in the last 24 hours from any category and articles from each + * parent category (up to four articles). If the article is a headline, the + * article's headline field is set to true. By default, the response includes + * up to 12 headline articles. To specify the number of headline articles to + * return, set the + * [headlineCount](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#headlineCount) + * query parameter. + */ + category?: string; + /** + * @member {number} [count] The number of news articles to return in the + * response. The actual number delivered may be less than requested. The + * default is 10 and the maximum value is 100. The actual number delivered + * may be less than requested.You may use this parameter along with the + * offset parameter to page results. For example, if your user interface + * displays 20 articles per page, set count to 20 and offset to 0 to get the + * first page of results. For each subsequent page, increment offset by 20 + * (for example, 0, 20, 40). It is possible for multiple pages to include + * some overlap in results. If you do not specify the + * [category](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#category) + * parameter, Bing ignores this parameter. + */ + count?: number; + /** + * @member {number} [headlineCount] The number of headline articles to return + * in the response. The default is 12. Specify this parameter only if you do + * not specify the + * [category](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#category) + * parameter. + */ + headlineCount?: number; + /** + * @member {string} [market] The market where the results come from. + * Typically, mkt is the country where the user is making the request from. + * However, it could be a different country if the user is not located in a + * country where Bing delivers results. The market must be in the form + * -. For example, en-US. The string is case + * insensitive. For a list of possible market values, see [Market + * Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#market-codes). + * NOTE: If known, you are encouraged to always specify the market. + * Specifying the market helps Bing route the request and return an + * appropriate and optimal response. If you specify a market that is not + * listed in [Market + * Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#market-codes), + * Bing uses a best fit market code based on an internal mapping that is + * subject to change. This parameter and the + * [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#cc) + * query parameter are mutually exclusive—do not specify both. + */ + market?: string; + /** + * @member {number} [offset] The zero-based offset that indicates the number + * of news to skip before returning news. The default is 0. The offset should + * be less than + * ([totalEstimatedMatches](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#news-totalmatches) + * - count). Use this parameter along with the count parameter to page + * results. For example, if your user interface displays 20 news per page, + * set count to 20 and offset to 0 to get the first page of results. For each + * subsequent page, increment offset by 20 (for example, 0, 20, 40). It is + * possible for multiple pages to include some overlap in results. If you do + * not specify the + * [category](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#category) + * parameter, Bing ignores this parameter. + */ + offset?: number; + /** + * @member {boolean} [originalImage] A Boolean value that determines whether + * the image's contentUrl contains a URL that points to a thumbnail of the + * original article's image or the image itself. If the article includes an + * image, and this parameter is set to true, the image's contentUrl property + * contains a URL that you may use to download the original image from the + * publisher's website. Otherwise, if this parameter is false, the image's + * contentUrl and thumbnailUrl URLs both point to the same thumbnail image. + * Use this parameter only with the News Search API or News Category API. + * Trending Topics API ignore this parameter. + */ + originalImage?: boolean; + /** + * @member {SafeSearch} [safeSearch] Filter news for adult content. The + * following are the possible filter values. Off: Return news articles with + * adult text, images, or videos. Moderate: Return news articles with adult + * text but not adult images or videos. Strict: Do not return news articles + * with adult text, images, or videos. If the request comes from a market + * that Bing's adult policy requires that safeSearch is set to Strict, Bing + * ignores the safeSearch value and uses Strict. If you use the site: query + * operator, there is the chance that the response may contain adult content + * regardless of what the safeSearch query parameter is set to. Use site: + * only if you are aware of the content on the site and your scenario + * supports the possibility of adult content. Possible values include: 'Off', + * 'Moderate', 'Strict' + */ + safeSearch?: SafeSearch; + /** + * @member {string} [setLang] The language to use for user interface strings. + * Specify the language using the ISO 639-1 2-letter language code. For + * example, the language code for English is EN. The default is EN (English). + * Although optional, you should always specify the language. Typically, you + * set setLang to the same language specified by mkt unless the user wants + * the user interface strings displayed in a different language. This + * parameter and the + * [Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#acceptlanguage) + * header are mutually exclusive; do not specify both. A user interface + * string is a string that's used as a label in a user interface. There are + * few user interface strings in the JSON response objects. Also, any links + * to Bing.com properties in the response objects apply the specified + * language. + */ + setLang?: string; + /** + * @member {boolean} [textDecorations] A Boolean value that determines + * whether display strings contain decoration markers such as hit + * highlighting characters. If true, the strings may include markers. The + * default is false. To specify whether to use Unicode characters or HTML + * tags as the markers, see the + * [textFormat](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#textformat) + * query parameter. For information about hit highlighting, see [Hit + * Highlighting](https://docs.microsoft.com/azure/cognitive-services/bing-news-search/hit-highlighting). + */ + textDecorations?: boolean; + /** + * @member {TextFormat} [textFormat] The type of markers to use for text + * decorations (see the textDecorations query parameter). Possible values are + * Raw—Use Unicode characters to mark content that needs special formatting. + * The Unicode characters are in the range E000 through E019. For example, + * Bing uses E000 and E001 to mark the beginning and end of query terms for + * hit highlighting. HTML—Use HTML tags to mark content that needs special + * formatting. For example, use tags to highlight query terms in display + * strings. The default is Raw. For display strings that contain escapable + * HTML characters such as <, >, and &, if textFormat is set to HTML, Bing + * escapes the characters as appropriate (for example, < is escaped to <). + * Possible values include: 'Raw', 'Html' + */ + textFormat?: TextFormat; +} + +/** + * @interface + * An interface representing NewsTrendingOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface NewsTrendingOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [acceptLanguage] A comma-delimited list of one or more + * languages to use for user interface strings. The list is in decreasing + * order of preference. For additional information, including expected + * format, see + * [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This + * header and the + * [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#setlang) + * query parameter are mutually exclusive; do not specify both. If you set + * this header, you must also specify the + * [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#cc) + * query parameter. To determine the market to return results for, Bing uses + * the first supported language it finds from the list and combines it with + * the cc parameter value. If the list does not include a supported language, + * Bing finds the closest language and market that supports the request or it + * uses an aggregated or default market for the results. To determine the + * market that Bing used, see the BingAPIs-Market header. Use this header and + * the cc query parameter only if you specify multiple languages. Otherwise, + * use the + * [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#mkt) + * and + * [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#setlang) + * query parameters. A user interface string is a string that's used as a + * label in a user interface. There are few user interface strings in the + * JSON response objects. Any links to Bing.com properties in the response + * objects apply the specified language. + */ + acceptLanguage?: string; + /** + * @member {string} [userAgent] The user agent originating the request. Bing + * uses the user agent to provide mobile users with an optimized experience. + * Although optional, you are encouraged to always specify this header. The + * user-agent should be the same string that any commonly used browser sends. + * For information about user agents, see [RFC + * 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). The + * following are examples of user-agent strings. Windows Phone: Mozilla/5.0 + * (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; + * ARM; Touch; NOKIA; Lumia 822). Android: Mozilla / 5.0 (Linux; U; Android + * 2.3.5; en - us; SCH - I500 Build / GINGERBREAD) AppleWebKit / 533.1 + * (KHTML; like Gecko) Version / 4.0 Mobile Safari / 533.1. iPhone: Mozilla / + * 5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit / 536.26 (KHTML; + * like Gecko) Mobile / 10B142 iPhone4; 1 BingWeb / 3.03.1428.20120423. PC: + * Mozilla / 5.0 (Windows NT 6.3; WOW64; Trident / 7.0; Touch; rv:11.0) like + * Gecko. iPad: Mozilla / 5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit / + * 537.51.1 (KHTML, like Gecko) Version / 7.0 Mobile / 11A465 Safari / + * 9537.53 + */ + userAgent?: string; + /** + * @member {string} [clientId] Bing uses this header to provide users with + * consistent behavior across Bing API calls. Bing often flights new features + * and improvements, and it uses the client ID as a key for assigning traffic + * on different flights. If you do not use the same client ID for a user + * across multiple requests, then Bing may assign the user to multiple + * conflicting flights. Being assigned to multiple conflicting flights can + * lead to an inconsistent user experience. For example, if the second + * request has a different flight assignment than the first, the experience + * may be unexpected. Also, Bing can use the client ID to tailor web results + * to that client ID’s search history, providing a richer experience for the + * user. Bing also uses this header to help improve result rankings by + * analyzing the activity generated by a client ID. The relevance + * improvements help with better quality of results delivered by Bing APIs + * and in turn enables higher click-through rates for the API consumer. + * IMPORTANT: Although optional, you should consider this header required. + * Persisting the client ID across multiple requests for the same end user + * and device combination enables 1) the API consumer to receive a consistent + * user experience, and 2) higher click-through rates via better quality of + * results from the Bing APIs. Each user that uses your application on the + * device must have a unique, Bing generated client ID. If you do not include + * this header in the request, Bing generates an ID and returns it in the + * X-MSEdge-ClientID response header. The only time that you should NOT + * include this header in a request is the first time the user uses your app + * on that device. Use the client ID for each Bing API request that your app + * makes for this user on the device. Persist the client ID. To persist the + * ID in a browser app, use a persistent HTTP cookie to ensure the ID is used + * across all sessions. Do not use a session cookie. For other apps such as + * mobile apps, use the device's persistent storage to persist the ID. The + * next time the user uses your app on that device, get the client ID that + * you persisted. Bing responses may or may not include this header. If the + * response includes this header, capture the client ID and use it for all + * subsequent Bing requests for the user on that device. If you include the + * X-MSEdge-ClientID, you must not include cookies in the request. + */ + clientId?: string; + /** + * @member {string} [clientIp] The IPv4 or IPv6 address of the client device. + * The IP address is used to discover the user's location. Bing uses the + * location information to determine safe search behavior. Although optional, + * you are encouraged to always specify this header and the X-Search-Location + * header. Do not obfuscate the address (for example, by changing the last + * octet to 0). Obfuscating the address results in the location not being + * anywhere near the device's actual location, which may result in Bing + * serving erroneous results. + */ + clientIp?: string; + /** + * @member {string} [location] A semicolon-delimited list of key/value pairs + * that describe the client's geographical location. Bing uses the location + * information to determine safe search behavior and to return relevant local + * content. Specify the key/value pair as :. The following are + * the keys that you use to specify the user's location. lat (required): The + * latitude of the client's location, in degrees. The latitude must be + * greater than or equal to -90.0 and less than or equal to +90.0. Negative + * values indicate southern latitudes and positive values indicate northern + * latitudes. long (required): The longitude of the client's location, in + * degrees. The longitude must be greater than or equal to -180.0 and less + * than or equal to +180.0. Negative values indicate western longitudes and + * positive values indicate eastern longitudes. re (required): The radius, in + * meters, which specifies the horizontal accuracy of the coordinates. Pass + * the value returned by the device's location service. Typical values might + * be 22m for GPS/Wi-Fi, 380m for cell tower triangulation, and 18,000m for + * reverse IP lookup. ts (optional): The UTC UNIX timestamp of when the + * client was at the location. (The UNIX timestamp is the number of seconds + * since January 1, 1970.) head (optional): The client's relative heading or + * direction of travel. Specify the direction of travel as degrees from 0 + * through 360, counting clockwise relative to true north. Specify this key + * only if the sp key is nonzero. sp (optional): The horizontal velocity + * (speed), in meters per second, that the client device is traveling. alt + * (optional): The altitude of the client device, in meters. are (optional): + * The radius, in meters, that specifies the vertical accuracy of the + * coordinates. Specify this key only if you specify the alt key. Although + * many of the keys are optional, the more information that you provide, the + * more accurate the location results are. Although optional, you are + * encouraged to always specify the user's geographical location. Providing + * the location is especially important if the client's IP address does not + * accurately reflect the user's physical location (for example, if the + * client uses VPN). For optimal results, you should include this header and + * the X-MSEdge-ClientIP header, but at a minimum, you should include this + * header. + */ + location?: string; + /** + * @member {string} [countryCode] A 2-character country code of the country + * where the results come from. This API supports only the United States + * market. If you specify this query parameter, it must be set to us. If you + * set this parameter, you must also specify the Accept-Language header. Bing + * uses the first supported language it finds from the languages list, and + * combine that language with the country code that you specify to determine + * the market to return results for. If the languages list does not include a + * supported language, Bing finds the closest language and market that + * supports the request, or it may use an aggregated or default market for + * the results instead of a specified one. You should use this query + * parameter and the Accept-Language query parameter only if you specify + * multiple languages; otherwise, you should use the mkt and setLang query + * parameters. This parameter and the mkt query parameter are mutually + * exclusive—do not specify both. + */ + countryCode?: string; + /** + * @member {number} [count] The number of news articles to return in the + * response. The actual number delivered may be less than requested. The + * default is 10 and the maximum value is 100. The actual number delivered + * may be less than requested.You may use this parameter along with the + * offset parameter to page results. For example, if your user interface + * displays 20 articles per page, set count to 20 and offset to 0 to get the + * first page of results. For each subsequent page, increment offset by 20 + * (for example, 0, 20, 40). It is possible for multiple pages to include + * some overlap in results. + */ + count?: number; + /** + * @member {string} [market] The market where the results come from. + * Typically, mkt is the country where the user is making the request from. + * However, it could be a different country if the user is not located in a + * country where Bing delivers results. The market must be in the form + * -. For example, en-US. The string is case + * insensitive. For a list of possible market values, see [Market + * Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#market-codes). + * NOTE: If known, you are encouraged to always specify the market. + * Specifying the market helps Bing route the request and return an + * appropriate and optimal response. If you specify a market that is not + * listed in [Market + * Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#market-codes), + * Bing uses a best fit market code based on an internal mapping that is + * subject to change. This parameter and the + * [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#cc) + * query parameter are mutually exclusive—do not specify both. + */ + market?: string; + /** + * @member {number} [offset] The zero-based offset that indicates the number + * of news to skip before returning news. The default is 0. The offset should + * be less than + * ([totalEstimatedMatches](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#news-totalmatches) + * - count). Use this parameter along with the count parameter to page + * results. For example, if your user interface displays 20 news per page, + * set count to 20 and offset to 0 to get the first page of results. For each + * subsequent page, increment offset by 20 (for example, 0, 20, 40). It is + * possible for multiple pages to include some overlap in results. + */ + offset?: number; + /** + * @member {SafeSearch} [safeSearch] Filter news for adult content. The + * following are the possible filter values. Off: Return news articles with + * adult text, images, or videos. Moderate: Return news articles with adult + * text but not adult images or videos. Strict: Do not return news articles + * with adult text, images, or videos. If the request comes from a market + * that Bing's adult policy requires that safeSearch is set to Strict, Bing + * ignores the safeSearch value and uses Strict. If you use the site: query + * operator, there is the chance that the response may contain adult content + * regardless of what the safeSearch query parameter is set to. Use site: + * only if you are aware of the content on the site and your scenario + * supports the possibility of adult content. Possible values include: 'Off', + * 'Moderate', 'Strict' + */ + safeSearch?: SafeSearch; + /** + * @member {string} [setLang] The language to use for user interface strings. + * Specify the language using the ISO 639-1 2-letter language code. For + * example, the language code for English is EN. The default is EN (English). + * Although optional, you should always specify the language. Typically, you + * set setLang to the same language specified by mkt unless the user wants + * the user interface strings displayed in a different language. This + * parameter and the + * [Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#acceptlanguage) + * header are mutually exclusive; do not specify both. A user interface + * string is a string that's used as a label in a user interface. There are + * few user interface strings in the JSON response objects. Also, any links + * to Bing.com properties in the response objects apply the specified + * language. + */ + setLang?: string; + /** + * @member {number} [since] The Unix epoch time (Unix timestamp) that Bing + * uses to select the trending topics. Bing returns trending topics that it + * discovered on or after the specified date and time, not the date the topic + * was published. To use this parameter, also specify the sortBy parameter. + * Use this parameter only with the News Trending Topics API. Do not specify + * this parameter when calling the News Search API or News Category API. + */ + since?: number; + /** + * @member {string} [sortBy] The order to return the news in. The following + * are the possible case-insensitive values. Date: If the request is through + * the News Search API, the response returns news articles sorted by date + * from the most recent to the oldest. If the request is through the News + * Trending Topics API, the response returns trending topics sorted by date + * from the most recent to the oldest. + */ + sortBy?: string; + /** + * @member {boolean} [textDecorations] A Boolean value that determines + * whether display strings contain decoration markers such as hit + * highlighting characters. If true, the strings may include markers. The + * default is false. To specify whether to use Unicode characters or HTML + * tags as the markers, see the + * [textFormat](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#textformat) + * query parameter. For information about hit highlighting, see [Hit + * Highlighting](https://docs.microsoft.com/azure/cognitive-services/bing-news-search/hit-highlighting). + */ + textDecorations?: boolean; + /** + * @member {TextFormat} [textFormat] The type of markers to use for text + * decorations (see the textDecorations query parameter). Possible values are + * Raw—Use Unicode characters to mark content that needs special formatting. + * The Unicode characters are in the range E000 through E019. For example, + * Bing uses E000 and E001 to mark the beginning and end of query terms for + * hit highlighting. HTML—Use HTML tags to mark content that needs special + * formatting. For example, use tags to highlight query terms in display + * strings. The default is Raw. For display strings that contain escapable + * HTML characters such as <, >, and &, if textFormat is set to HTML, Bing + * escapes the characters as appropriate (for example, < is escaped to <). + * Possible values include: 'Raw', 'Html' + */ + textFormat?: TextFormat; +} + +/** + * Defines values for ErrorCode. + * Possible values include: 'None', 'ServerError', 'InvalidRequest', + * 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization' + * There could be more values for this enum apart from the ones defined here.If + * you want to set a value that is not from the known values then you can do + * the following: + * let param: ErrorCode = "someUnknownValueThatWillStillBeValid"; + * @readonly + * @enum {string} + */ +export enum ErrorCode { + None = 'None', + ServerError = 'ServerError', + InvalidRequest = 'InvalidRequest', + RateLimitExceeded = 'RateLimitExceeded', + InvalidAuthorization = 'InvalidAuthorization', + InsufficientAuthorization = 'InsufficientAuthorization', +} + +/** + * Defines values for ErrorSubCode. + * Possible values include: 'UnexpectedError', 'ResourceError', + * 'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue', + * 'HttpNotAllowed', 'Blocked', 'AuthorizationMissing', + * 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' + * There could be more values for this enum apart from the ones defined here.If + * you want to set a value that is not from the known values then you can do + * the following: + * let param: ErrorSubCode = + * "someUnknownValueThatWillStillBeValid"; + * @readonly + * @enum {string} + */ +export enum ErrorSubCode { + UnexpectedError = 'UnexpectedError', + ResourceError = 'ResourceError', + NotImplemented = 'NotImplemented', + ParameterMissing = 'ParameterMissing', + ParameterInvalidValue = 'ParameterInvalidValue', + HttpNotAllowed = 'HttpNotAllowed', + Blocked = 'Blocked', + AuthorizationMissing = 'AuthorizationMissing', + AuthorizationRedundancy = 'AuthorizationRedundancy', + AuthorizationDisabled = 'AuthorizationDisabled', + AuthorizationExpired = 'AuthorizationExpired', +} + +/** + * Defines values for Freshness. + * Possible values include: 'Day', 'Week', 'Month' + * There could be more values for this enum apart from the ones defined here.If + * you want to set a value that is not from the known values then you can do + * the following: + * let param: Freshness = "someUnknownValueThatWillStillBeValid"; + * @readonly + * @enum {string} + */ +export enum Freshness { + Day = 'Day', + Week = 'Week', + Month = 'Month', +} + +/** + * Defines values for SafeSearch. + * Possible values include: 'Off', 'Moderate', 'Strict' + * There could be more values for this enum apart from the ones defined here.If + * you want to set a value that is not from the known values then you can do + * the following: + * let param: SafeSearch = "someUnknownValueThatWillStillBeValid"; + * @readonly + * @enum {string} + */ +export enum SafeSearch { + Off = 'Off', + Moderate = 'Moderate', + Strict = 'Strict', +} + +/** + * Defines values for TextFormat. + * Possible values include: 'Raw', 'Html' + * There could be more values for this enum apart from the ones defined here.If + * you want to set a value that is not from the known values then you can do + * the following: + * let param: TextFormat = "someUnknownValueThatWillStillBeValid"; + * @readonly + * @enum {string} + */ +export enum TextFormat { + Raw = 'Raw', + Html = 'Html', +} + +/** + * Contains response data for the search operation. + */ +export type NewsSearchResponse = News & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: News; + }; +}; + +/** + * Contains response data for the category operation. + */ +export type NewsCategoryResponse = News & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: News; + }; +}; + +/** + * Contains response data for the trending operation. + */ +export type NewsTrendingResponse = TrendingTopics & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: TrendingTopics; + }; +}; diff --git a/packages/@azure/cognitiveservices-newssearch/lib/models/mappers.ts b/packages/@azure/cognitiveservices-newssearch/lib/models/mappers.ts new file mode 100644 index 000000000000..25a335a7defb --- /dev/null +++ b/packages/@azure/cognitiveservices-newssearch/lib/models/mappers.ts @@ -0,0 +1,686 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "ms-rest-js"; + + +export const ResponseBase: msRest.CompositeMapper = { + serializedName: "ResponseBase", + type: { + name: "Composite", + polymorphicDiscriminator: { + serializedName: "_type", + clientName: "_type" + }, + uberParent: "ResponseBase", + className: "ResponseBase", + modelProperties: { + _type: { + required: true, + serializedName: "_type", + type: { + name: "String" + } + } + } + } +}; + +export const Identifiable: msRest.CompositeMapper = { + serializedName: "Identifiable", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "Identifiable", + modelProperties: { + ...ResponseBase.type.modelProperties, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const Response: msRest.CompositeMapper = { + serializedName: "Response", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "Response", + modelProperties: { + ...Identifiable.type.modelProperties, + webSearchUrl: { + readOnly: true, + serializedName: "webSearchUrl", + type: { + name: "String" + } + } + } + } +}; + +export const Thing: msRest.CompositeMapper = { + serializedName: "Thing", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "Thing", + modelProperties: { + ...Response.type.modelProperties, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + url: { + readOnly: true, + serializedName: "url", + type: { + name: "String" + } + }, + image: { + readOnly: true, + serializedName: "image", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "ImageObject" + } + }, + description: { + readOnly: true, + serializedName: "description", + type: { + name: "String" + } + }, + alternateName: { + readOnly: true, + serializedName: "alternateName", + type: { + name: "String" + } + }, + bingId: { + readOnly: true, + serializedName: "bingId", + type: { + name: "String" + } + } + } + } +}; + +export const CreativeWork: msRest.CompositeMapper = { + serializedName: "CreativeWork", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "CreativeWork", + modelProperties: { + ...Thing.type.modelProperties, + thumbnailUrl: { + readOnly: true, + serializedName: "thumbnailUrl", + type: { + name: "String" + } + }, + provider: { + readOnly: true, + serializedName: "provider", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "Thing" + } + } + } + }, + datePublished: { + readOnly: true, + serializedName: "datePublished", + type: { + name: "String" + } + }, + video: { + readOnly: true, + serializedName: "video", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "VideoObject" + } + } + } + } +}; + +export const Article: msRest.CompositeMapper = { + serializedName: "Article", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "Article", + modelProperties: { + ...CreativeWork.type.modelProperties, + wordCount: { + readOnly: true, + serializedName: "wordCount", + type: { + name: "Number" + } + } + } + } +}; + +export const NewsArticle: msRest.CompositeMapper = { + serializedName: "NewsArticle", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "NewsArticle", + modelProperties: { + ...Article.type.modelProperties, + category: { + readOnly: true, + serializedName: "category", + type: { + name: "String" + } + }, + headline: { + readOnly: true, + serializedName: "headline", + type: { + name: "Boolean" + } + }, + clusteredArticles: { + readOnly: true, + serializedName: "clusteredArticles", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "NewsArticle" + } + } + } + } + } + } +}; + +export const Answer: msRest.CompositeMapper = { + serializedName: "Answer", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "Answer", + modelProperties: { + ...Response.type.modelProperties, + followUpQueries: { + readOnly: true, + serializedName: "followUpQueries", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Query" + } + } + } + } + } + } +}; + +export const SearchResultsAnswer: msRest.CompositeMapper = { + serializedName: "SearchResultsAnswer", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "SearchResultsAnswer", + modelProperties: { + ...Answer.type.modelProperties, + totalEstimatedMatches: { + readOnly: true, + serializedName: "totalEstimatedMatches", + type: { + name: "Number" + } + } + } + } +}; + +export const News: msRest.CompositeMapper = { + serializedName: "News", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "News", + modelProperties: { + ...SearchResultsAnswer.type.modelProperties, + value: { + required: true, + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "NewsArticle" + } + } + } + }, + location: { + readOnly: true, + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const MediaObject: msRest.CompositeMapper = { + serializedName: "MediaObject", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "MediaObject", + modelProperties: { + ...CreativeWork.type.modelProperties, + contentUrl: { + readOnly: true, + serializedName: "contentUrl", + type: { + name: "String" + } + }, + width: { + readOnly: true, + serializedName: "width", + type: { + name: "Number" + } + }, + height: { + readOnly: true, + serializedName: "height", + type: { + name: "Number" + } + } + } + } +}; + +export const ImageObject: msRest.CompositeMapper = { + serializedName: "ImageObject", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "ImageObject", + modelProperties: { + ...MediaObject.type.modelProperties, + thumbnail: { + readOnly: true, + serializedName: "thumbnail", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "ImageObject" + } + } + } + } +}; + +export const Query: msRest.CompositeMapper = { + serializedName: "Query", + type: { + name: "Composite", + className: "Query", + modelProperties: { + text: { + required: true, + serializedName: "text", + type: { + name: "String" + } + }, + displayText: { + readOnly: true, + serializedName: "displayText", + type: { + name: "String" + } + }, + webSearchUrl: { + readOnly: true, + serializedName: "webSearchUrl", + type: { + name: "String" + } + }, + searchLink: { + readOnly: true, + serializedName: "searchLink", + type: { + name: "String" + } + }, + thumbnail: { + readOnly: true, + serializedName: "thumbnail", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "ImageObject" + } + } + } + } +}; + +export const NewsTopic: msRest.CompositeMapper = { + serializedName: "News/Topic", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "NewsTopic", + modelProperties: { + ...Thing.type.modelProperties, + isBreakingNews: { + readOnly: true, + serializedName: "isBreakingNews", + type: { + name: "Boolean" + } + }, + query: { + readOnly: true, + serializedName: "query", + type: { + name: "Composite", + className: "Query" + } + }, + newsSearchUrl: { + readOnly: true, + serializedName: "newsSearchUrl", + type: { + name: "String" + } + } + } + } +}; + +export const TrendingTopics: msRest.CompositeMapper = { + serializedName: "TrendingTopics", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "TrendingTopics", + modelProperties: { + ...Answer.type.modelProperties, + value: { + required: true, + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "NewsTopic" + } + } + } + } + } + } +}; + +export const VideoObject: msRest.CompositeMapper = { + serializedName: "VideoObject", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "VideoObject", + modelProperties: { + ...MediaObject.type.modelProperties, + motionThumbnailUrl: { + readOnly: true, + serializedName: "motionThumbnailUrl", + type: { + name: "String" + } + }, + motionThumbnailId: { + readOnly: true, + serializedName: "motionThumbnailId", + type: { + name: "String" + } + }, + embedHtml: { + readOnly: true, + serializedName: "embedHtml", + type: { + name: "String" + } + }, + allowHttpsEmbed: { + readOnly: true, + serializedName: "allowHttpsEmbed", + type: { + name: "Boolean" + } + }, + viewCount: { + readOnly: true, + serializedName: "viewCount", + type: { + name: "Number" + } + }, + thumbnail: { + readOnly: true, + serializedName: "thumbnail", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "ImageObject" + } + }, + videoId: { + readOnly: true, + serializedName: "videoId", + type: { + name: "String" + } + }, + allowMobileEmbed: { + readOnly: true, + serializedName: "allowMobileEmbed", + type: { + name: "Boolean" + } + }, + isSuperfresh: { + readOnly: true, + serializedName: "isSuperfresh", + type: { + name: "Boolean" + } + } + } + } +}; + +export const Organization: msRest.CompositeMapper = { + serializedName: "Organization", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "Organization", + modelProperties: { + ...Thing.type.modelProperties + } + } +}; + +export const ErrorModel: msRest.CompositeMapper = { + serializedName: "Error", + type: { + name: "Composite", + className: "ErrorModel", + modelProperties: { + code: { + required: true, + serializedName: "code", + defaultValue: 'None', + type: { + name: "String" + } + }, + subCode: { + readOnly: true, + serializedName: "subCode", + type: { + name: "String" + } + }, + message: { + required: true, + serializedName: "message", + type: { + name: "String" + } + }, + moreDetails: { + readOnly: true, + serializedName: "moreDetails", + type: { + name: "String" + } + }, + parameter: { + readOnly: true, + serializedName: "parameter", + type: { + name: "String" + } + }, + value: { + readOnly: true, + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + polymorphicDiscriminator: ResponseBase.type.polymorphicDiscriminator, + uberParent: "ResponseBase", + className: "ErrorResponse", + modelProperties: { + ...Response.type.modelProperties, + errors: { + required: true, + serializedName: "errors", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorModel" + } + } + } + } + } + } +}; + +export const discriminators = { + 'ResponseBase.NewsArticle' : NewsArticle, + 'ResponseBase.News' : News, + 'ResponseBase.SearchResultsAnswer' : SearchResultsAnswer, + 'ResponseBase.ImageObject' : ImageObject, + 'ResponseBase.News/Topic' : NewsTopic, + 'ResponseBase.Answer' : Answer, + 'ResponseBase.Article' : Article, + 'ResponseBase.Thing' : Thing, + 'ResponseBase.Response' : Response, + 'ResponseBase.TrendingTopics' : TrendingTopics, + 'ResponseBase.VideoObject' : VideoObject, + 'ResponseBase.CreativeWork' : CreativeWork, + 'ResponseBase.Organization' : Organization, + 'ResponseBase.Identifiable' : Identifiable, + 'ResponseBase.ErrorResponse' : ErrorResponse, + 'ResponseBase.MediaObject' : MediaObject, + 'ResponseBase' : ResponseBase +}; diff --git a/packages/@azure/cognitiveservices-newssearch/lib/models/newsOperationsMappers.ts b/packages/@azure/cognitiveservices-newssearch/lib/models/newsOperationsMappers.ts new file mode 100644 index 000000000000..ff10c22a9a53 --- /dev/null +++ b/packages/@azure/cognitiveservices-newssearch/lib/models/newsOperationsMappers.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + discriminators, + News, + SearchResultsAnswer, + Answer, + Response, + Identifiable, + ResponseBase, + Query, + ImageObject, + MediaObject, + CreativeWork, + Thing, + VideoObject, + NewsArticle, + Article, + ErrorResponse, + ErrorModel, + TrendingTopics, + NewsTopic, + Organization +} from "../models/mappers"; + diff --git a/packages/@azure/cognitiveservices-newssearch/lib/models/parameters.ts b/packages/@azure/cognitiveservices-newssearch/lib/models/parameters.ts new file mode 100644 index 000000000000..5c320f6e429f --- /dev/null +++ b/packages/@azure/cognitiveservices-newssearch/lib/models/parameters.ts @@ -0,0 +1,262 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: [ + "options", + "acceptLanguage" + ], + mapper: { + serializedName: "Accept-Language", + type: { + name: "String" + } + } +}; +export const category: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "category" + ], + mapper: { + serializedName: "category", + type: { + name: "String" + } + } +}; +export const clientId: msRest.OperationParameter = { + parameterPath: [ + "options", + "clientId" + ], + mapper: { + serializedName: "X-MSEdge-ClientID", + type: { + name: "String" + } + } +}; +export const clientIp: msRest.OperationParameter = { + parameterPath: [ + "options", + "clientIp" + ], + mapper: { + serializedName: "X-MSEdge-ClientIP", + type: { + name: "String" + } + } +}; +export const count: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "count" + ], + mapper: { + serializedName: "count", + type: { + name: "Number" + } + } +}; +export const countryCode: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "countryCode" + ], + mapper: { + serializedName: "cc", + type: { + name: "String" + } + } +}; +export const freshness: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "freshness" + ], + mapper: { + serializedName: "freshness", + type: { + name: "String" + } + } +}; +export const headlineCount: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "headlineCount" + ], + mapper: { + serializedName: "headlineCount", + type: { + name: "Number" + } + } +}; +export const location: msRest.OperationParameter = { + parameterPath: [ + "options", + "location" + ], + mapper: { + serializedName: "X-Search-Location", + type: { + name: "String" + } + } +}; +export const market: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "market" + ], + mapper: { + serializedName: "mkt", + type: { + name: "String" + } + } +}; +export const offset: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "offset" + ], + mapper: { + serializedName: "offset", + type: { + name: "Number" + } + } +}; +export const originalImage: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "originalImage" + ], + mapper: { + serializedName: "originalImg", + type: { + name: "Boolean" + } + } +}; +export const query: msRest.OperationQueryParameter = { + parameterPath: "query", + mapper: { + required: true, + serializedName: "q", + type: { + name: "String" + } + } +}; +export const safeSearch: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "safeSearch" + ], + mapper: { + serializedName: "safeSearch", + type: { + name: "String" + } + } +}; +export const setLang: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "setLang" + ], + mapper: { + serializedName: "setLang", + type: { + name: "String" + } + } +}; +export const since: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "since" + ], + mapper: { + serializedName: "since", + type: { + name: "Number" + } + } +}; +export const sortBy: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "sortBy" + ], + mapper: { + serializedName: "sortBy", + type: { + name: "String" + } + } +}; +export const textDecorations: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "textDecorations" + ], + mapper: { + serializedName: "textDecorations", + type: { + name: "Boolean" + } + } +}; +export const textFormat: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "textFormat" + ], + mapper: { + serializedName: "textFormat", + type: { + name: "String" + } + } +}; +export const userAgent: msRest.OperationParameter = { + parameterPath: [ + "options", + "userAgent" + ], + mapper: { + serializedName: "User-Agent", + type: { + name: "String" + } + } +}; +export const xBingApisSDK: msRest.OperationParameter = { + parameterPath: "xBingApisSDK", + mapper: { + required: true, + isConstant: true, + serializedName: "X-BingApis-SDK", + defaultValue: 'true', + type: { + name: "String" + } + } +}; diff --git a/packages/@azure/cognitiveservices-newssearch/lib/newsSearchAPIClient.ts b/packages/@azure/cognitiveservices-newssearch/lib/newsSearchAPIClient.ts new file mode 100644 index 000000000000..9e91f8e9b353 --- /dev/null +++ b/packages/@azure/cognitiveservices-newssearch/lib/newsSearchAPIClient.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { NewsSearchAPIClientContext } from "./newsSearchAPIClientContext"; + +class NewsSearchAPIClient extends NewsSearchAPIClientContext { + // Operation groups + news: operations.NewsOperations; + + /** + * Initializes a new instance of the NewsSearchAPIClient class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, options?: Models.NewsSearchAPIClientOptions) { + super(credentials, options); + this.news = new operations.NewsOperations(this); + } +} + +// Operation Specifications + +export { + NewsSearchAPIClient, + NewsSearchAPIClientContext, + Models as NewsSearchAPIModels, + Mappers as NewsSearchAPIMappers +}; +export * from "./operations"; diff --git a/packages/@azure/cognitiveservices-newssearch/lib/newsSearchAPIClientContext.ts b/packages/@azure/cognitiveservices-newssearch/lib/newsSearchAPIClientContext.ts new file mode 100644 index 000000000000..2ec9caaaac37 --- /dev/null +++ b/packages/@azure/cognitiveservices-newssearch/lib/newsSearchAPIClientContext.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "ms-rest-js"; +import * as Models from "./models"; + +const packageName = "@azure/cognitiveservices-newssearch"; +const packageVersion = "1.0.0"; + +export class NewsSearchAPIClientContext extends msRest.ServiceClient { + credentials: msRest.ServiceClientCredentials; + + /** + * Initializes a new instance of the NewsSearchAPIClientContext class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, options?: Models.NewsSearchAPIClientOptions) { + if (credentials === null || credentials === undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + + if (!options) { + options = {}; + } + + super(credentials, options); + + this.baseUri = options.baseUri || this.baseUri || "https://api.cognitive.microsoft.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + + this.addUserAgentInfo(`${packageName}/${packageVersion}`); + } +} diff --git a/packages/@azure/cognitiveservices-newssearch/lib/operations/index.ts b/packages/@azure/cognitiveservices-newssearch/lib/operations/index.ts new file mode 100644 index 000000000000..83d0fe873ea9 --- /dev/null +++ b/packages/@azure/cognitiveservices-newssearch/lib/operations/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./newsOperations"; diff --git a/packages/@azure/cognitiveservices-newssearch/lib/operations/newsOperations.ts b/packages/@azure/cognitiveservices-newssearch/lib/operations/newsOperations.ts new file mode 100644 index 000000000000..69c08a670ac5 --- /dev/null +++ b/packages/@azure/cognitiveservices-newssearch/lib/operations/newsOperations.ts @@ -0,0 +1,239 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/newsOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { NewsSearchAPIClientContext } from "../newsSearchAPIClientContext"; + +/** Class representing a NewsOperations. */ +export class NewsOperations { + private readonly client: NewsSearchAPIClientContext; + + /** + * Create a NewsOperations. + * @param {NewsSearchAPIClientContext} client Reference to the service client. + */ + constructor(client: NewsSearchAPIClientContext) { + this.client = client; + } + + /** + * @summary The News Search API lets you send a search query to Bing and get back a list of news + * that are relevant to the search query. This section provides technical details about the query + * parameters and headers that you use to request news and the JSON response objects that contain + * them. For examples that show how to make requests, see [Searching the web for + * news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web). + * @param query The user's search query string. The query string cannot be empty. The query string + * may contain [Bing Advanced Operators](http://msdn.microsoft.com/library/ff795620.aspx). For + * example, to limit news to a specific domain, use the + * [site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. Use this parameter only with + * the News Search API. Do not specify this parameter when calling the Trending Topics API or News + * Category API. + * @param [options] The optional parameters + * @returns Promise + */ + search(query: string, options?: Models.NewsSearchOptionalParams): Promise; + /** + * @param query The user's search query string. The query string cannot be empty. The query string + * may contain [Bing Advanced Operators](http://msdn.microsoft.com/library/ff795620.aspx). For + * example, to limit news to a specific domain, use the + * [site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. Use this parameter only with + * the News Search API. Do not specify this parameter when calling the Trending Topics API or News + * Category API. + * @param callback The callback + */ + search(query: string, callback: msRest.ServiceCallback): void; + /** + * @param query The user's search query string. The query string cannot be empty. The query string + * may contain [Bing Advanced Operators](http://msdn.microsoft.com/library/ff795620.aspx). For + * example, to limit news to a specific domain, use the + * [site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. Use this parameter only with + * the News Search API. Do not specify this parameter when calling the Trending Topics API or News + * Category API. + * @param options The optional parameters + * @param callback The callback + */ + search(query: string, options: Models.NewsSearchOptionalParams, callback: msRest.ServiceCallback): void; + search(query: string, options?: Models.NewsSearchOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + query, + options + }, + searchOperationSpec, + callback) as Promise; + } + + /** + * @summary The News Category API lets lets you search on Bing and get back a list of top news + * articles by category. This section provides technical details about the query parameters and + * headers that you use to request news and the JSON response objects that contain them. For + * examples that show how to make requests, see [Searching the web for + * news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web). + * @param [options] The optional parameters + * @returns Promise + */ + category(options?: Models.NewsCategoryOptionalParams): Promise; + /** + * @param callback The callback + */ + category(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + category(options: Models.NewsCategoryOptionalParams, callback: msRest.ServiceCallback): void; + category(options?: Models.NewsCategoryOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + categoryOperationSpec, + callback) as Promise; + } + + /** + * @summary The News Trending Topics API lets lets you search on Bing and get back a list of + * trending news topics that are currently trending on Bing. This section provides technical + * details about the query parameters and headers that you use to request news and the JSON + * response objects that contain them. For examples that show how to make requests, see [Searching + * the web for + * news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web). + * @param [options] The optional parameters + * @returns Promise + */ + trending(options?: Models.NewsTrendingOptionalParams): Promise; + /** + * @param callback The callback + */ + trending(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + trending(options: Models.NewsTrendingOptionalParams, callback: msRest.ServiceCallback): void; + trending(options?: Models.NewsTrendingOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + trendingOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const searchOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "bing/v7.0/news/search", + queryParameters: [ + Parameters.countryCode, + Parameters.count, + Parameters.freshness, + Parameters.market, + Parameters.offset, + Parameters.originalImage, + Parameters.query, + Parameters.safeSearch, + Parameters.setLang, + Parameters.sortBy, + Parameters.textDecorations, + Parameters.textFormat + ], + headerParameters: [ + Parameters.xBingApisSDK, + Parameters.acceptLanguage, + Parameters.userAgent, + Parameters.clientId, + Parameters.clientIp, + Parameters.location + ], + responses: { + 200: { + bodyMapper: Mappers.News + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const categoryOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "bing/v7.0/news", + queryParameters: [ + Parameters.countryCode, + Parameters.category, + Parameters.count, + Parameters.headlineCount, + Parameters.market, + Parameters.offset, + Parameters.originalImage, + Parameters.safeSearch, + Parameters.setLang, + Parameters.textDecorations, + Parameters.textFormat + ], + headerParameters: [ + Parameters.xBingApisSDK, + Parameters.acceptLanguage, + Parameters.userAgent, + Parameters.clientId, + Parameters.clientIp, + Parameters.location + ], + responses: { + 200: { + bodyMapper: Mappers.News + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const trendingOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "bing/v7.0/news/trendingtopics", + queryParameters: [ + Parameters.countryCode, + Parameters.count, + Parameters.market, + Parameters.offset, + Parameters.safeSearch, + Parameters.setLang, + Parameters.since, + Parameters.sortBy, + Parameters.textDecorations, + Parameters.textFormat + ], + headerParameters: [ + Parameters.xBingApisSDK, + Parameters.acceptLanguage, + Parameters.userAgent, + Parameters.clientId, + Parameters.clientIp, + Parameters.location + ], + responses: { + 200: { + bodyMapper: Mappers.TrendingTopics + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/packages/@azure/cognitiveservices-newssearch/package.json b/packages/@azure/cognitiveservices-newssearch/package.json new file mode 100644 index 000000000000..7017bd37a4ca --- /dev/null +++ b/packages/@azure/cognitiveservices-newssearch/package.json @@ -0,0 +1,41 @@ +{ + "name": "@azure/cognitiveservices-newssearch", + "author": "Microsoft Corporation", + "description": "NewsSearchAPIClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "ms-rest-js": "^1.0.439", + "tslib": "^1.9.3" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/cognitiveservices-newssearch.js", + "module": "./esm/newsSearchAPIClient.js", + "types": "./esm/newsSearchAPIClient.d.ts", + "devDependencies": { + "typescript": "^3.1.1", + "rollup": "^0.66.2", + "rollup-plugin-node-resolve": "^3.4.0", + "uglify-js": "^3.4.9" + }, + "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/cognitiveservices-newssearch", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-js/issues" + }, + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/cognitiveservices-newssearch.js.map'\" -o ./dist/cognitiveservices-newssearch.min.js ./dist/cognitiveservices-newssearch.js", + "prepare": "npm run build" + }, + "sideEffects": false +} diff --git a/packages/@azure/cognitiveservices-newssearch/rollup.config.js b/packages/@azure/cognitiveservices-newssearch/rollup.config.js new file mode 100644 index 000000000000..bee26ca226e1 --- /dev/null +++ b/packages/@azure/cognitiveservices-newssearch/rollup.config.js @@ -0,0 +1,31 @@ +import nodeResolve from "rollup-plugin-node-resolve"; +/** + * @type {import('rollup').RollupFileOptions} + */ +const config = { + input: './esm/newsSearchAPIClient.js', + external: ["ms-rest-js", "ms-rest-azure-js"], + output: { + file: "./dist/cognitiveservices-newssearch.js", + format: "umd", + name: "Azure.CognitiveservicesNewssearch", + sourcemap: true, + globals: { + "ms-rest-js": "msRest", + "ms-rest-azure-js": "msRestAzure" + }, + banner: `/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */` + }, + plugins: [ + nodeResolve({ module: true }) + ] +}; +export default config; diff --git a/packages/@azure/cognitiveservices-newssearch/tsconfig.json b/packages/@azure/cognitiveservices-newssearch/tsconfig.json new file mode 100644 index 000000000000..f32d1664f320 --- /dev/null +++ b/packages/@azure/cognitiveservices-newssearch/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./lib/**/*"], + "exclude": ["node_modules"] +} From 2ec813cbb1b1dd6936e01d27de902a679975d33e Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik Date: Fri, 19 Oct 2018 12:38:43 -0700 Subject: [PATCH 2/2] Regenerated "@azure/cognitiveservices-newssearch" SDK. --- packages/@azure/cognitiveservices-newssearch/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@azure/cognitiveservices-newssearch/package.json b/packages/@azure/cognitiveservices-newssearch/package.json index 7017bd37a4ca..78ad1e9adfc8 100644 --- a/packages/@azure/cognitiveservices-newssearch/package.json +++ b/packages/@azure/cognitiveservices-newssearch/package.json @@ -4,7 +4,7 @@ "description": "NewsSearchAPIClient Library with typescript type definitions for node.js and browser.", "version": "1.0.0", "dependencies": { - "ms-rest-js": "^1.0.439", + "ms-rest-js": "^1.0.443", "tslib": "^1.9.3" }, "keywords": [ @@ -24,7 +24,7 @@ "rollup-plugin-node-resolve": "^3.4.0", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/cognitiveservices-newssearch", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git"