diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/AzSdk.RP.props b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/AzSdk.RP.props new file mode 100644 index 000000000000..39645fa6dc05 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/AzSdk.RP.props @@ -0,0 +1,7 @@ + + + + + $(PackageTags);$(CommonTags);$(AzureApiTag); + + \ No newline at end of file diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch.Tests/BingLocalSearch.Tests.csproj b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch.Tests/BingLocalSearch.Tests.csproj new file mode 100644 index 000000000000..490817ba34b0 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch.Tests/BingLocalSearch.Tests.csproj @@ -0,0 +1,26 @@ + + + + BingLocalSearch.Tests + 1.0.0-preview + BingLocalSearch.Tests + BingLocalSearch.Tests Class Library + + + + + 2.0 + + + + + + + PreserveNewest + + + + + + + \ No newline at end of file diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch.Tests/LocalSearchTests.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch.Tests/LocalSearchTests.cs new file mode 100644 index 000000000000..a3dceed0f61f --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch.Tests/LocalSearchTests.cs @@ -0,0 +1,33 @@ +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Azure.CognitiveServices.Search.LocalSearch; +using Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using System.Linq; +using Xunit; + +namespace SearchSDK.Tests +{ + public class LocalSearchTests + { + private static string SubscriptionKey = "fake"; + + // [Fact] + public void LocalSearch() + { + using (MockContext context = MockContext.Start(this.GetType().FullName)) + { + HttpMockServer.Initialize(this.GetType().FullName, "LocalSearch"); + + ILocalSearchClient client = new LocalSearchClient(new ApiKeyServiceClientCredentials(SubscriptionKey), HttpMockServer.CreateInstance()); + + var resp = client.Local.Search(query: "restaurants"); + + Assert.NotNull(resp); + Assert.NotNull(resp.QueryContext); + Assert.NotNull(resp.Places); + Assert.NotNull(resp.Places.Value); + } + } + } +} + diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch.sln b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch.sln new file mode 100644 index 000000000000..50c81a40ad4a --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28010.2019 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BingLocalSearch", "BingLocalSearch\BingLocalSearch.csproj", "{E9CFAA11-ADCB-4CE6-8478-ECC4753E7E8F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E9CFAA11-ADCB-4CE6-8478-ECC4753E7E8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E9CFAA11-ADCB-4CE6-8478-ECC4753E7E8F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E9CFAA11-ADCB-4CE6-8478-ECC4753E7E8F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E9CFAA11-ADCB-4CE6-8478-ECC4753E7E8F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8D427FAB-986B-4B80-8831-4C6B4FCD87F0} + EndGlobalSection +EndGlobal diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/BingLocalSearch.csproj b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/BingLocalSearch.csproj new file mode 100644 index 000000000000..4e71389c3698 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/BingLocalSearch.csproj @@ -0,0 +1,33 @@ + + + + + + + Microsoft.Azure.CognitiveServices.Search.LocalSearch + Provides ability to search for businesses + 0.9.0-preview + Microsoft.Azure.CognitiveServices.BingLocalSearch + CognitiveServices;Bing;BingLocalSearch;LocalSearch;Local Search + + + + + + + net452;netstandard1.4 + + + + + + diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Customizations/ApiKeyServiceClientCredentials.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Customizations/ApiKeyServiceClientCredentials.cs new file mode 100644 index 000000000000..2728244f0dc3 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Customizations/ApiKeyServiceClientCredentials.cs @@ -0,0 +1,43 @@ +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch +{ + using System; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using Microsoft.Rest; + + /// + /// Allows authentication to the API using a basic apiKey mechanism + /// + public class ApiKeyServiceClientCredentials : ServiceClientCredentials + { + private readonly string subscriptionKey; + + /// + /// Creates a new instance of the ApiKeyServiceClientCredentails class + /// + /// The subscription key to authenticate and authorize as + public ApiKeyServiceClientCredentials(string subscriptionKey) + { + if (string.IsNullOrWhiteSpace(subscriptionKey)) + throw new ArgumentNullException("subscriptionKey"); + + this.subscriptionKey = subscriptionKey; + } + + /// + /// Add the Basic Authentication Header to each outgoing request + /// + /// The outgoing request + /// A token to cancel the operation + public override Task ProcessHttpRequestAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + if (request == null) + throw new ArgumentNullException("request"); + + request.Headers.Add("Ocp-Apim-Subscription-Key", this.subscriptionKey); + + return Task.FromResult(null); + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/ILocal.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/ILocal.cs new file mode 100644 index 000000000000..ceb0776c03d7 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/ILocal.cs @@ -0,0 +1,252 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch +{ + using Microsoft.Rest; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Local operations. + /// + public partial interface ILocal + { + /// + /// The Local Search API lets you send a search query to Bing and get + /// back search results that include local businesses such as + /// restaurants, hotels, retail stores, or other local businesses. The + /// query can specify the name of the local business or it can ask for + /// a list (for example, restaurants near me). + /// + /// + /// The user's search term. + /// + /// + /// 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 query parameter are mutually exclusive; + /// do not specify both. If you set this header, you must also specify + /// the cc query parameter. Bing will use the first supported language + /// it finds from the list, and combine that language with the cc + /// parameter value to determine the market to return results for. If + /// the list does not include a supported language, Bing will find the + /// closest language and market that supports the request, and may use + /// an aggregated or default market for the results instead of a + /// specified one. You should use this header and the cc query + /// parameter only if you specify multiple languages; otherwise, you + /// should use the mkt and setLang query parameters. A user interface + /// string is a string that's used as a label in a user interface. + /// There are very few user interface strings in the JSON response + /// objects. Any links in the response objects to Bing.com properties + /// will apply the specified language. + /// + /// + /// By default, Bing returns cached content, if available. To prevent + /// Bing from returning cached content, set the Pragma header to + /// no-cache (for example, Pragma: no-cache). + /// + /// + /// The user agent originating the request. Bing uses the user agent to + /// provide mobile users with an optimized experience. Although + /// optional, you are strongly encouraged to always specify this + /// header. The user-agent should be the same string that any commonly + /// used browser would send. For information about user agents, see + /// [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + /// + /// + /// 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. + /// + /// + /// 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. + /// + /// + /// 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 <key>:<value>. + /// 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. + /// + /// + /// 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. + /// + /// + /// The market where the results come from. You are strongly encouraged + /// to always specify the market, if known. Specifying the market helps + /// Bing route the request and return an appropriate and optimal + /// response. This parameter and the cc query parameter are mutually + /// exclusive—do not specify both. + /// + /// + /// comma-delimiated list of business categories to search for. + /// Supported categories can be high-level such as EatDrink, Shop, + /// SeeDo. + /// + /// + /// Preferred location to search around, expressed as Latitude, + /// longitude and radius in meters. For example + /// 47.61503,-122.1719,5000. Note that circular view should only be + /// used to indicate a search around a point on the map, not as an + /// approximation for a view port of a map rectangle. + /// + /// + /// Preferred bounding box for results, specified in NW_latitude, + /// NW_Longitude, SE_Latitude, SE_Longitude format. For example + /// 47.64,-122.13,47.63,-122.12. These values are lat, long pairs for + /// the Northwest corner and the Southeast corner of a rectangle. + /// + /// + /// Preferred number of results to return. If not specified, then Bing + /// returns 1-20 of the most relevant results. + /// + /// + /// First result to return. zero-based. default is 0. + /// + /// + /// The media type to use for the response. The following are the + /// possible case-insensitive values: JSON, JSONLD. The default is + /// JSON. If you specify JSONLD, the response body includes JSON-LD + /// objects that contain the search results. + /// + /// + /// A filter used to filter adult content. Off: Return webpages with + /// adult text, images, or videos. Moderate: Return webpages with adult + /// text, but not adult images or videos. Strict: Do not return + /// webpages with adult text, images, or videos. The default is + /// Moderate. 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' + /// + /// + /// 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 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. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> SearchWithHttpMessagesAsync(string query, string acceptLanguage = default(string), string pragma = default(string), string userAgent = default(string), string clientId = default(string), string clientIp = default(string), string location = default(string), string countryCode = default(string), string market = "en-us", string localCategories = default(string), string localCircularView = default(string), string localMapView = default(string), string count = default(string), string first = default(string), IList responseFormat = default(IList), string safeSearch = default(string), string setLang = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/ILocalSearchClient.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/ILocalSearchClient.cs new file mode 100644 index 000000000000..c5f4832e11ac --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/ILocalSearchClient.cs @@ -0,0 +1,50 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch +{ + using Microsoft.Rest; + using Models; + using Newtonsoft.Json; + + /// + /// The Local Search client lets you send a search query to Bing and get + /// back search results that include local businesses such as restaurants, + /// hotels, retail stores, or other local businesses. The query can specify + /// the name of the local business or it can ask for a list (for example, + /// restaurants near me). + /// + public partial interface ILocalSearchClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Subscription credentials which uniquely identify client + /// subscription. + /// + ServiceClientCredentials Credentials { get; } + + + /// + /// Gets the ILocal. + /// + ILocal Local { get; } + + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Local.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Local.cs new file mode 100644 index 000000000000..c119e37be51e --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Local.cs @@ -0,0 +1,509 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch +{ + using Microsoft.Rest; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Local operations. + /// + public partial class Local : IServiceOperations, ILocal + { + /// + /// Initializes a new instance of the Local class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + public Local(LocalSearchClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the LocalSearchClient + /// + public LocalSearchClient Client { get; private set; } + + /// + /// The Local Search API lets you send a search query to Bing and get back + /// search results that include local businesses such as restaurants, hotels, + /// retail stores, or other local businesses. The query can specify the name of + /// the local business or it can ask for a list (for example, restaurants near + /// me). + /// + /// + /// The user's search term. + /// + /// + /// 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 query parameter are mutually exclusive; do not + /// specify both. If you set this header, you must also specify the cc query + /// parameter. Bing will use the first supported language it finds from the + /// list, and combine that language with the cc parameter value to determine + /// the market to return results for. If the list does not include a supported + /// language, Bing will find the closest language and market that supports the + /// request, and may use an aggregated or default market for the results + /// instead of a specified one. You should use this header and the cc query + /// parameter only if you specify multiple languages; otherwise, you should use + /// the mkt and setLang query parameters. A user interface string is a string + /// that's used as a label in a user interface. There are very few user + /// interface strings in the JSON response objects. Any links in the response + /// objects to Bing.com properties will apply the specified language. + /// + /// + /// By default, Bing returns cached content, if available. To prevent Bing from + /// returning cached content, set the Pragma header to no-cache (for example, + /// Pragma: no-cache). + /// + /// + /// The user agent originating the request. Bing uses the user agent to provide + /// mobile users with an optimized experience. Although optional, you are + /// strongly encouraged to always specify this header. The user-agent should be + /// the same string that any commonly used browser would send. For information + /// about user agents, see [RFC + /// 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + /// + /// + /// 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. + /// + /// + /// 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. + /// + /// + /// 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 <key>:<value>. 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. + /// + /// + /// 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. + /// + /// + /// The market where the results come from. You are strongly encouraged to + /// always specify the market, if known. Specifying the market helps Bing route + /// the request and return an appropriate and optimal response. This parameter + /// and the cc query parameter are mutually exclusive—do not specify both. + /// + /// + /// comma-delimiated list of business categories to search for. Supported + /// categories can be high-level such as EatDrink, Shop, SeeDo. + /// + /// + /// Preferred location to search around, expressed as Latitude, longitude and + /// radius in meters. For example 47.61503,-122.1719,5000. Note that circular + /// view should only be used to indicate a search around a point on the map, + /// not as an approximation for a view port of a map rectangle. + /// + /// + /// Preferred bounding box for results, specified in NW_latitude, NW_Longitude, + /// SE_Latitude, SE_Longitude format. For example 47.64,-122.13,47.63,-122.12. + /// These values are lat, long pairs for the Northwest corner and the Southeast + /// corner of a rectangle. + /// + /// + /// Preferred number of results to return. If not specified, then Bing returns + /// 1-20 of the most relevant results. + /// + /// + /// First result to return. zero-based. default is 0. + /// + /// + /// The media type to use for the response. The following are the possible + /// case-insensitive values: JSON, JSONLD. The default is JSON. If you specify + /// JSONLD, the response body includes JSON-LD objects that contain the search + /// results. + /// + /// + /// A filter used to filter adult content. Off: Return webpages with adult + /// text, images, or videos. Moderate: Return webpages with adult text, but not + /// adult images or videos. Strict: Do not return webpages with adult text, + /// images, or videos. The default is Moderate. 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' + /// + /// + /// 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 + /// 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. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> SearchWithHttpMessagesAsync(string query, string acceptLanguage = default(string), string pragma = default(string), string userAgent = default(string), string clientId = default(string), string clientIp = default(string), string location = default(string), string countryCode = default(string), string market = "en-us", string localCategories = default(string), string localCircularView = default(string), string localMapView = default(string), string count = default(string), string first = default(string), IList responseFormat = default(IList), string safeSearch = default(string), string setLang = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (query == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "query"); + } + string xBingApisSDK = "true"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("xBingApisSDK", xBingApisSDK); + tracingParameters.Add("acceptLanguage", acceptLanguage); + tracingParameters.Add("pragma", pragma); + tracingParameters.Add("userAgent", userAgent); + tracingParameters.Add("clientId", clientId); + tracingParameters.Add("clientIp", clientIp); + tracingParameters.Add("location", location); + tracingParameters.Add("countryCode", countryCode); + tracingParameters.Add("market", market); + tracingParameters.Add("query", query); + tracingParameters.Add("localCategories", localCategories); + tracingParameters.Add("localCircularView", localCircularView); + tracingParameters.Add("localMapView", localMapView); + tracingParameters.Add("count", count); + tracingParameters.Add("first", first); + tracingParameters.Add("responseFormat", responseFormat); + tracingParameters.Add("safeSearch", safeSearch); + tracingParameters.Add("setLang", setLang); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Search", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "localbusinesses/v7.0/search").ToString(); + List _queryParameters = new List(); + if (countryCode != null) + { + _queryParameters.Add(string.Format("cc={0}", System.Uri.EscapeDataString(countryCode))); + } + if (market != null) + { + _queryParameters.Add(string.Format("mkt={0}", System.Uri.EscapeDataString(market))); + } + if (query != null) + { + _queryParameters.Add(string.Format("q={0}", System.Uri.EscapeDataString(query))); + } + if (localCategories != null) + { + _queryParameters.Add(string.Format("localcategories={0}", System.Uri.EscapeDataString(localCategories))); + } + if (localCircularView != null) + { + _queryParameters.Add(string.Format("localcircularview={0}", System.Uri.EscapeDataString(localCircularView))); + } + if (localMapView != null) + { + _queryParameters.Add(string.Format("localmapview={0}", System.Uri.EscapeDataString(localMapView))); + } + if (count != null) + { + _queryParameters.Add(string.Format("count={0}", System.Uri.EscapeDataString(count))); + } + if (first != null) + { + _queryParameters.Add(string.Format("first={0}", System.Uri.EscapeDataString(first))); + } + if (responseFormat != null) + { + _queryParameters.Add(string.Format("ResponseFormat={0}", System.Uri.EscapeDataString(string.Join(",", responseFormat)))); + } + if (safeSearch != null) + { + _queryParameters.Add(string.Format("SafeSearch={0}", System.Uri.EscapeDataString(safeSearch))); + } + if (setLang != null) + { + _queryParameters.Add(string.Format("SetLang={0}", System.Uri.EscapeDataString(setLang))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (xBingApisSDK != null) + { + if (_httpRequest.Headers.Contains("X-BingApis-SDK")) + { + _httpRequest.Headers.Remove("X-BingApis-SDK"); + } + _httpRequest.Headers.TryAddWithoutValidation("X-BingApis-SDK", xBingApisSDK); + } + if (acceptLanguage != null) + { + if (_httpRequest.Headers.Contains("Accept-Language")) + { + _httpRequest.Headers.Remove("Accept-Language"); + } + _httpRequest.Headers.TryAddWithoutValidation("Accept-Language", acceptLanguage); + } + if (pragma != null) + { + if (_httpRequest.Headers.Contains("Pragma")) + { + _httpRequest.Headers.Remove("Pragma"); + } + _httpRequest.Headers.TryAddWithoutValidation("Pragma", pragma); + } + if (userAgent != null) + { + if (_httpRequest.Headers.Contains("User-Agent")) + { + _httpRequest.Headers.Remove("User-Agent"); + } + _httpRequest.Headers.TryAddWithoutValidation("User-Agent", userAgent); + } + if (clientId != null) + { + if (_httpRequest.Headers.Contains("X-MSEdge-ClientID")) + { + _httpRequest.Headers.Remove("X-MSEdge-ClientID"); + } + _httpRequest.Headers.TryAddWithoutValidation("X-MSEdge-ClientID", clientId); + } + if (clientIp != null) + { + if (_httpRequest.Headers.Contains("X-MSEdge-ClientIP")) + { + _httpRequest.Headers.Remove("X-MSEdge-ClientIP"); + } + _httpRequest.Headers.TryAddWithoutValidation("X-MSEdge-ClientIP", clientIp); + } + if (location != null) + { + if (_httpRequest.Headers.Contains("X-Search-Location")) + { + _httpRequest.Headers.Remove("X-Search-Location"); + } + _httpRequest.Headers.TryAddWithoutValidation("X-Search-Location", location); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/LocalExtensions.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/LocalExtensions.cs new file mode 100644 index 000000000000..7ddb697cc3ba --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/LocalExtensions.cs @@ -0,0 +1,433 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch +{ + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Local. + /// + public static partial class LocalExtensions + { + /// + /// The Local Search API lets you send a search query to Bing and get back + /// search results that include local businesses such as restaurants, hotels, + /// retail stores, or other local businesses. The query can specify the name of + /// the local business or it can ask for a list (for example, restaurants near + /// me). + /// + /// + /// The operations group for this extension method. + /// + /// + /// The user's search term. + /// + /// + /// 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 query parameter are mutually exclusive; do not + /// specify both. If you set this header, you must also specify the cc query + /// parameter. Bing will use the first supported language it finds from the + /// list, and combine that language with the cc parameter value to determine + /// the market to return results for. If the list does not include a supported + /// language, Bing will find the closest language and market that supports the + /// request, and may use an aggregated or default market for the results + /// instead of a specified one. You should use this header and the cc query + /// parameter only if you specify multiple languages; otherwise, you should use + /// the mkt and setLang query parameters. A user interface string is a string + /// that's used as a label in a user interface. There are very few user + /// interface strings in the JSON response objects. Any links in the response + /// objects to Bing.com properties will apply the specified language. + /// + /// + /// By default, Bing returns cached content, if available. To prevent Bing from + /// returning cached content, set the Pragma header to no-cache (for example, + /// Pragma: no-cache). + /// + /// + /// The user agent originating the request. Bing uses the user agent to provide + /// mobile users with an optimized experience. Although optional, you are + /// strongly encouraged to always specify this header. The user-agent should be + /// the same string that any commonly used browser would send. For information + /// about user agents, see [RFC + /// 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + /// + /// + /// 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. + /// + /// + /// 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. + /// + /// + /// 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 <key>:<value>. 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. + /// + /// + /// 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. + /// + /// + /// The market where the results come from. You are strongly encouraged to + /// always specify the market, if known. Specifying the market helps Bing route + /// the request and return an appropriate and optimal response. This parameter + /// and the cc query parameter are mutually exclusive—do not specify both. + /// + /// + /// comma-delimiated list of business categories to search for. Supported + /// categories can be high-level such as EatDrink, Shop, SeeDo. + /// + /// + /// Preferred location to search around, expressed as Latitude, longitude and + /// radius in meters. For example 47.61503,-122.1719,5000. Note that circular + /// view should only be used to indicate a search around a point on the map, + /// not as an approximation for a view port of a map rectangle. + /// + /// + /// Preferred bounding box for results, specified in NW_latitude, NW_Longitude, + /// SE_Latitude, SE_Longitude format. For example 47.64,-122.13,47.63,-122.12. + /// These values are lat, long pairs for the Northwest corner and the Southeast + /// corner of a rectangle. + /// + /// + /// Preferred number of results to return. If not specified, then Bing returns + /// 1-20 of the most relevant results. + /// + /// + /// First result to return. zero-based. default is 0. + /// + /// + /// The media type to use for the response. The following are the possible + /// case-insensitive values: JSON, JSONLD. The default is JSON. If you specify + /// JSONLD, the response body includes JSON-LD objects that contain the search + /// results. + /// + /// + /// A filter used to filter adult content. Off: Return webpages with adult + /// text, images, or videos. Moderate: Return webpages with adult text, but not + /// adult images or videos. Strict: Do not return webpages with adult text, + /// images, or videos. The default is Moderate. 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' + /// + /// + /// 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 + /// 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. + /// + public static SearchResponse Search(this ILocal operations, string query, string acceptLanguage = default(string), string pragma = default(string), string userAgent = default(string), string clientId = default(string), string clientIp = default(string), string location = default(string), string countryCode = default(string), string market = "en-us", string localCategories = default(string), string localCircularView = default(string), string localMapView = default(string), string count = default(string), string first = default(string), IList responseFormat = default(IList), string safeSearch = default(string), string setLang = default(string)) + { + return operations.SearchAsync(query, acceptLanguage, pragma, userAgent, clientId, clientIp, location, countryCode, market, localCategories, localCircularView, localMapView, count, first, responseFormat, safeSearch, setLang).GetAwaiter().GetResult(); + } + + /// + /// The Local Search API lets you send a search query to Bing and get back + /// search results that include local businesses such as restaurants, hotels, + /// retail stores, or other local businesses. The query can specify the name of + /// the local business or it can ask for a list (for example, restaurants near + /// me). + /// + /// + /// The operations group for this extension method. + /// + /// + /// The user's search term. + /// + /// + /// 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 query parameter are mutually exclusive; do not + /// specify both. If you set this header, you must also specify the cc query + /// parameter. Bing will use the first supported language it finds from the + /// list, and combine that language with the cc parameter value to determine + /// the market to return results for. If the list does not include a supported + /// language, Bing will find the closest language and market that supports the + /// request, and may use an aggregated or default market for the results + /// instead of a specified one. You should use this header and the cc query + /// parameter only if you specify multiple languages; otherwise, you should use + /// the mkt and setLang query parameters. A user interface string is a string + /// that's used as a label in a user interface. There are very few user + /// interface strings in the JSON response objects. Any links in the response + /// objects to Bing.com properties will apply the specified language. + /// + /// + /// By default, Bing returns cached content, if available. To prevent Bing from + /// returning cached content, set the Pragma header to no-cache (for example, + /// Pragma: no-cache). + /// + /// + /// The user agent originating the request. Bing uses the user agent to provide + /// mobile users with an optimized experience. Although optional, you are + /// strongly encouraged to always specify this header. The user-agent should be + /// the same string that any commonly used browser would send. For information + /// about user agents, see [RFC + /// 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + /// + /// + /// 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. + /// + /// + /// 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. + /// + /// + /// 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 <key>:<value>. 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. + /// + /// + /// 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. + /// + /// + /// The market where the results come from. You are strongly encouraged to + /// always specify the market, if known. Specifying the market helps Bing route + /// the request and return an appropriate and optimal response. This parameter + /// and the cc query parameter are mutually exclusive—do not specify both. + /// + /// + /// comma-delimiated list of business categories to search for. Supported + /// categories can be high-level such as EatDrink, Shop, SeeDo. + /// + /// + /// Preferred location to search around, expressed as Latitude, longitude and + /// radius in meters. For example 47.61503,-122.1719,5000. Note that circular + /// view should only be used to indicate a search around a point on the map, + /// not as an approximation for a view port of a map rectangle. + /// + /// + /// Preferred bounding box for results, specified in NW_latitude, NW_Longitude, + /// SE_Latitude, SE_Longitude format. For example 47.64,-122.13,47.63,-122.12. + /// These values are lat, long pairs for the Northwest corner and the Southeast + /// corner of a rectangle. + /// + /// + /// Preferred number of results to return. If not specified, then Bing returns + /// 1-20 of the most relevant results. + /// + /// + /// First result to return. zero-based. default is 0. + /// + /// + /// The media type to use for the response. The following are the possible + /// case-insensitive values: JSON, JSONLD. The default is JSON. If you specify + /// JSONLD, the response body includes JSON-LD objects that contain the search + /// results. + /// + /// + /// A filter used to filter adult content. Off: Return webpages with adult + /// text, images, or videos. Moderate: Return webpages with adult text, but not + /// adult images or videos. Strict: Do not return webpages with adult text, + /// images, or videos. The default is Moderate. 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' + /// + /// + /// 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 + /// 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. + /// + /// + /// The cancellation token. + /// + public static async Task SearchAsync(this ILocal operations, string query, string acceptLanguage = default(string), string pragma = default(string), string userAgent = default(string), string clientId = default(string), string clientIp = default(string), string location = default(string), string countryCode = default(string), string market = "en-us", string localCategories = default(string), string localCircularView = default(string), string localMapView = default(string), string count = default(string), string first = default(string), IList responseFormat = default(IList), string safeSearch = default(string), string setLang = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.SearchWithHttpMessagesAsync(query, acceptLanguage, pragma, userAgent, clientId, clientIp, location, countryCode, market, localCategories, localCircularView, localMapView, count, first, responseFormat, safeSearch, setLang, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/LocalSearchClient.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/LocalSearchClient.cs new file mode 100644 index 000000000000..e2c56c2cb486 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/LocalSearchClient.cs @@ -0,0 +1,333 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Net; + using System.Net.Http; + + /// + /// The Local Search client lets you send a search query to Bing and get + /// back search results that include local businesses such as restaurants, + /// hotels, retail stores, or other local businesses. The query can specify + /// the name of the local business or it can ask for a list (for example, + /// restaurants near me). + /// + public partial class LocalSearchClient : ServiceClient, ILocalSearchClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Subscription credentials which uniquely identify client subscription. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// Gets the ILocal. + /// + public virtual ILocal Local { get; private set; } + + /// + /// Initializes a new instance of the LocalSearchClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling LocalSearchClient.Dispose(). False: will not dispose provided httpClient + protected LocalSearchClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the LocalSearchClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected LocalSearchClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the LocalSearchClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected LocalSearchClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the LocalSearchClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected LocalSearchClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the LocalSearchClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected LocalSearchClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the LocalSearchClient class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public LocalSearchClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the LocalSearchClient class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling LocalSearchClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public LocalSearchClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the LocalSearchClient class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public LocalSearchClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the LocalSearchClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public LocalSearchClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the LocalSearchClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public LocalSearchClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + Local = new Local(this); + BaseUri = new System.Uri("https://api.cognitive.microsoft.com/localbusinesses/v7.0/search"); + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("_type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("_type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("_type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("_type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("_type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("_type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("_type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("_type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("_type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("_type")); + CustomInitialize(); + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Action.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Action.cs new file mode 100644 index 000000000000..d87f147ed5f4 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Action.cs @@ -0,0 +1,133 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Defines an action. + /// + public partial class Action : CreativeWork + { + /// + /// Initializes a new instance of the Action class. + /// + public Action() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Action class. + /// + /// A String identifier. + /// The URL that returns this resource. + /// The URL to Bing's search result for this + /// item. + /// The name of the thing represented by this + /// object. + /// The URL to get more information about the thing + /// represented by this object. + /// Additional information about + /// the entity such as hints that you can use to determine the entity's + /// type. To determine the entity's type, use the entityScenario and + /// entityTypeHint fields. + /// The URL to a thumbnail of the + /// item. + /// For internal use only. + /// For internal use only. + /// The source of the creative work. + /// Text content of this creative work + /// The result produced in the action. + /// A display name for the action. + /// A Boolean representing whether this + /// result is the top action. + /// Use this URL to get additional data to + /// determine how to take the appropriate action. For example, the + /// serviceUrl might return JSON along with an image URL. + public Action(string id = default(string), string readLink = default(string), string webSearchUrl = default(string), IList potentialAction = default(IList), IList immediateAction = default(IList), string preferredClickthroughUrl = default(string), string adaptiveCard = default(string), string name = default(string), string url = default(string), EntitiesEntityPresentationInfo entityPresentationInfo = default(EntitiesEntityPresentationInfo), string thumbnailUrl = default(string), IList about = default(IList), IList mentions = default(IList), IList provider = default(IList), Thing creator = default(Thing), string text = default(string), string discussionUrl = default(string), int? commentCount = default(int?), Thing mainEntity = default(Thing), string headLine = default(string), Thing copyrightHolder = default(Thing), int? copyrightYear = default(int?), string disclaimer = default(string), bool? isAccessibleForFree = default(bool?), IList genre = default(IList), bool? isFamilyFriendly = default(bool?), IList location = default(IList), IList result = default(IList), string displayName = default(string), bool? isTopAction = default(bool?), string serviceUrl = default(string)) + : base(id, readLink, webSearchUrl, potentialAction, immediateAction, preferredClickthroughUrl, adaptiveCard, name, url, entityPresentationInfo, thumbnailUrl, about, mentions, provider, creator, text, discussionUrl, commentCount, mainEntity, headLine, copyrightHolder, copyrightYear, disclaimer, isAccessibleForFree, genre, isFamilyFriendly) + { + Location = location; + Result = result; + DisplayName = displayName; + IsTopAction = isTopAction; + ServiceUrl = serviceUrl; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "location")] + public IList Location { get; private set; } + + /// + /// Gets the result produced in the action. + /// + [JsonProperty(PropertyName = "result")] + public IList Result { get; private set; } + + /// + /// Gets a display name for the action. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets a Boolean representing whether this result is the top action. + /// + [JsonProperty(PropertyName = "isTopAction")] + public bool? IsTopAction { get; private set; } + + /// + /// Gets use this URL to get additional data to determine how to take + /// the appropriate action. For example, the serviceUrl might return + /// JSON along with an image URL. + /// + [JsonProperty(PropertyName = "serviceUrl")] + public string ServiceUrl { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Location != null) + { + foreach (var element in Location) + { + if (element != null) + { + element.Validate(); + } + } + } + if (Result != null) + { + foreach (var element1 in Result) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Answer.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Answer.cs new file mode 100644 index 000000000000..aea6477fa129 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Answer.cs @@ -0,0 +1,45 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Defines an answer. + /// + public partial class Answer : Response + { + /// + /// Initializes a new instance of the Answer class. + /// + public Answer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Answer class. + /// + /// A String identifier. + /// The URL that returns this resource. + /// The URL to Bing's search result for this + /// item. + public Answer(string id = default(string), string readLink = default(string), string webSearchUrl = default(string), IList potentialAction = default(IList), IList immediateAction = default(IList), string preferredClickthroughUrl = default(string), string adaptiveCard = default(string)) + : base(id, readLink, webSearchUrl, potentialAction, immediateAction, preferredClickthroughUrl, adaptiveCard) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/CreativeWork.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/CreativeWork.cs new file mode 100644 index 000000000000..d9b5a482328e --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/CreativeWork.cs @@ -0,0 +1,214 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The most generic kind of creative work, including books, movies, + /// photographs, software programs, etc. + /// + public partial class CreativeWork : Thing + { + /// + /// Initializes a new instance of the CreativeWork class. + /// + public CreativeWork() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CreativeWork class. + /// + /// A String identifier. + /// The URL that returns this resource. + /// The URL to Bing's search result for this + /// item. + /// The name of the thing represented by this + /// object. + /// The URL to get more information about the thing + /// represented by this object. + /// Additional information about + /// the entity such as hints that you can use to determine the entity's + /// type. To determine the entity's type, use the entityScenario and + /// entityTypeHint fields. + /// The URL to a thumbnail of the + /// item. + /// For internal use only. + /// For internal use only. + /// The source of the creative work. + /// Text content of this creative work + public CreativeWork(string id = default(string), string readLink = default(string), string webSearchUrl = default(string), IList potentialAction = default(IList), IList immediateAction = default(IList), string preferredClickthroughUrl = default(string), string adaptiveCard = default(string), string name = default(string), string url = default(string), EntitiesEntityPresentationInfo entityPresentationInfo = default(EntitiesEntityPresentationInfo), string thumbnailUrl = default(string), IList about = default(IList), IList mentions = default(IList), IList provider = default(IList), Thing creator = default(Thing), string text = default(string), string discussionUrl = default(string), int? commentCount = default(int?), Thing mainEntity = default(Thing), string headLine = default(string), Thing copyrightHolder = default(Thing), int? copyrightYear = default(int?), string disclaimer = default(string), bool? isAccessibleForFree = default(bool?), IList genre = default(IList), bool? isFamilyFriendly = default(bool?)) + : base(id, readLink, webSearchUrl, potentialAction, immediateAction, preferredClickthroughUrl, adaptiveCard, name, url, entityPresentationInfo) + { + ThumbnailUrl = thumbnailUrl; + About = about; + Mentions = mentions; + Provider = provider; + Creator = creator; + Text = text; + DiscussionUrl = discussionUrl; + CommentCount = commentCount; + MainEntity = mainEntity; + HeadLine = headLine; + CopyrightHolder = copyrightHolder; + CopyrightYear = copyrightYear; + Disclaimer = disclaimer; + IsAccessibleForFree = isAccessibleForFree; + Genre = genre; + IsFamilyFriendly = isFamilyFriendly; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the URL to a thumbnail of the item. + /// + [JsonProperty(PropertyName = "thumbnailUrl")] + public string ThumbnailUrl { get; private set; } + + /// + /// Gets for internal use only. + /// + [JsonProperty(PropertyName = "about")] + public IList About { get; private set; } + + /// + /// Gets for internal use only. + /// + [JsonProperty(PropertyName = "mentions")] + public IList Mentions { get; private set; } + + /// + /// Gets the source of the creative work. + /// + [JsonProperty(PropertyName = "provider")] + public IList Provider { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "creator")] + public Thing Creator { get; private set; } + + /// + /// Gets text content of this creative work + /// + [JsonProperty(PropertyName = "text")] + public string Text { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "discussionUrl")] + public string DiscussionUrl { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "commentCount")] + public int? CommentCount { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "mainEntity")] + public Thing MainEntity { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "headLine")] + public string HeadLine { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "copyrightHolder")] + public Thing CopyrightHolder { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "copyrightYear")] + public int? CopyrightYear { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "disclaimer")] + public string Disclaimer { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "isAccessibleForFree")] + public bool? IsAccessibleForFree { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "genre")] + public IList Genre { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "isFamilyFriendly")] + public bool? IsFamilyFriendly { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (About != null) + { + foreach (var element in About) + { + if (element != null) + { + element.Validate(); + } + } + } + if (Mentions != null) + { + foreach (var element1 in Mentions) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + if (Provider != null) + { + foreach (var element2 in Provider) + { + if (element2 != null) + { + element2.Validate(); + } + } + } + if (Creator != null) + { + Creator.Validate(); + } + if (MainEntity != null) + { + MainEntity.Validate(); + } + if (CopyrightHolder != null) + { + CopyrightHolder.Validate(); + } + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/EntitiesEntityPresentationInfo.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/EntitiesEntityPresentationInfo.cs new file mode 100644 index 000000000000..550c526a28a1 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/EntitiesEntityPresentationInfo.cs @@ -0,0 +1,107 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Defines additional information about an entity such as type hints. + /// + [Newtonsoft.Json.JsonObject("Entities/EntityPresentationInfo")] + public partial class EntitiesEntityPresentationInfo + { + /// + /// Initializes a new instance of the EntitiesEntityPresentationInfo + /// class. + /// + public EntitiesEntityPresentationInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EntitiesEntityPresentationInfo + /// class. + /// + /// The supported scenario. Possible + /// values include: 'DominantEntity', 'DisambiguationItem', + /// 'ListItem' + /// A list of hints that indicate the + /// entity's type. The list could contain a single hint such as Movie + /// or a list of hints such as Place, LocalBusiness, Restaurant. Each + /// successive hint in the array narrows the entity's type. + /// A display version of the entity + /// hint. For example, if entityTypeHints is Artist, this field may be + /// set to American Singer. + public EntitiesEntityPresentationInfo(string entityScenario, IList entityTypeHints = default(IList), string entityTypeDisplayHint = default(string), string query = default(string), IList entitySubTypeHints = default(IList)) + { + EntityScenario = entityScenario; + EntityTypeHints = entityTypeHints; + EntityTypeDisplayHint = entityTypeDisplayHint; + Query = query; + EntitySubTypeHints = entitySubTypeHints; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the supported scenario. Possible values include: + /// 'DominantEntity', 'DisambiguationItem', 'ListItem' + /// + [JsonProperty(PropertyName = "entityScenario")] + public string EntityScenario { get; set; } + + /// + /// Gets a list of hints that indicate the entity's type. The list + /// could contain a single hint such as Movie or a list of hints such + /// as Place, LocalBusiness, Restaurant. Each successive hint in the + /// array narrows the entity's type. + /// + [JsonProperty(PropertyName = "entityTypeHints")] + public IList EntityTypeHints { get; private set; } + + /// + /// Gets a display version of the entity hint. For example, if + /// entityTypeHints is Artist, this field may be set to American + /// Singer. + /// + [JsonProperty(PropertyName = "entityTypeDisplayHint")] + public string EntityTypeDisplayHint { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "query")] + public string Query { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "entitySubTypeHints")] + public IList EntitySubTypeHints { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (EntityScenario == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "EntityScenario"); + } + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/EntityScenario.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/EntityScenario.cs new file mode 100644 index 000000000000..5c27cd97fd67 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/EntityScenario.cs @@ -0,0 +1,19 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + + /// + /// Defines values for EntityScenario. + /// + public static class EntityScenario + { + public const string DominantEntity = "DominantEntity"; + public const string DisambiguationItem = "DisambiguationItem"; + public const string ListItem = "ListItem"; + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/EntityType.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/EntityType.cs new file mode 100644 index 000000000000..11b222e366d6 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/EntityType.cs @@ -0,0 +1,20 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + + /// + /// Defines values for EntityType. + /// + public static class EntityType + { + public const string Place = "Place"; + public const string LocalBusiness = "LocalBusiness"; + public const string Restaurant = "Restaurant"; + public const string Hotel = "Hotel"; + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Error.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Error.cs new file mode 100644 index 000000000000..fd27578f2c9e --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Error.cs @@ -0,0 +1,125 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines the error that occurred. + /// + public partial class Error + { + /// + /// Initializes a new instance of the Error class. + /// + public Error() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Error class. + /// + /// The error code that identifies the category of + /// error. Possible values include: 'None', 'ServerError', + /// 'InvalidRequest', 'RateLimitExceeded', 'InvalidAuthorization', + /// 'InsufficientAuthorization' + /// A description of the error. + /// The error code that further helps to identify + /// the error. Possible values include: 'UnexpectedError', + /// 'ResourceError', 'NotImplemented', 'ParameterMissing', + /// 'ParameterInvalidValue', 'HttpNotAllowed', 'Blocked', + /// 'AuthorizationMissing', 'AuthorizationRedundancy', + /// 'AuthorizationDisabled', 'AuthorizationExpired' + /// A description that provides additional + /// information about the error. + /// The parameter in the request that caused + /// the error. + /// The parameter's value in the request that was + /// not valid. + public Error(string code, string message, string subCode = default(string), string moreDetails = default(string), string parameter = default(string), string value = default(string)) + { + Code = code; + SubCode = subCode; + Message = message; + MoreDetails = moreDetails; + Parameter = parameter; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the error code that identifies the category of error. + /// Possible values include: 'None', 'ServerError', 'InvalidRequest', + /// 'RateLimitExceeded', 'InvalidAuthorization', + /// 'InsufficientAuthorization' + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets the error code that further helps to identify the error. + /// Possible values include: 'UnexpectedError', 'ResourceError', + /// 'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue', + /// 'HttpNotAllowed', 'Blocked', 'AuthorizationMissing', + /// 'AuthorizationRedundancy', 'AuthorizationDisabled', + /// 'AuthorizationExpired' + /// + [JsonProperty(PropertyName = "subCode")] + public string SubCode { get; private set; } + + /// + /// Gets or sets a description of the error. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Gets a description that provides additional information about the + /// error. + /// + [JsonProperty(PropertyName = "moreDetails")] + public string MoreDetails { get; private set; } + + /// + /// Gets the parameter in the request that caused the error. + /// + [JsonProperty(PropertyName = "parameter")] + public string Parameter { get; private set; } + + /// + /// Gets the parameter's value in the request that was not valid. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Code == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Code"); + } + if (Message == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Message"); + } + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ErrorCode.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ErrorCode.cs new file mode 100644 index 000000000000..24e3ea0e6360 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ErrorCode.cs @@ -0,0 +1,22 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + + /// + /// Defines values for ErrorCode. + /// + public static class ErrorCode + { + public const string None = "None"; + public const string ServerError = "ServerError"; + public const string InvalidRequest = "InvalidRequest"; + public const string RateLimitExceeded = "RateLimitExceeded"; + public const string InvalidAuthorization = "InvalidAuthorization"; + public const string InsufficientAuthorization = "InsufficientAuthorization"; + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ErrorResponse.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ErrorResponse.cs new file mode 100644 index 000000000000..3ab3884f72b5 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ErrorResponse.cs @@ -0,0 +1,80 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The top-level response that represents a failed request. + /// + public partial class ErrorResponse : Response + { + /// + /// Initializes a new instance of the ErrorResponse class. + /// + public ErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// A list of errors that describe the reasons why + /// the request failed. + /// A String identifier. + /// The URL that returns this resource. + /// The URL to Bing's search result for this + /// item. + public ErrorResponse(IList errors, string id = default(string), string readLink = default(string), string webSearchUrl = default(string), IList potentialAction = default(IList), IList immediateAction = default(IList), string preferredClickthroughUrl = default(string), string adaptiveCard = default(string)) + : base(id, readLink, webSearchUrl, potentialAction, immediateAction, preferredClickthroughUrl, adaptiveCard) + { + Errors = errors; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list of errors that describe the reasons why the + /// request failed. + /// + [JsonProperty(PropertyName = "errors")] + public IList Errors { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Errors == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Errors"); + } + if (Errors != null) + { + foreach (var element in Errors) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ErrorResponseException.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ErrorResponseException.cs new file mode 100644 index 000000000000..b816594da987 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ErrorResponseException.cs @@ -0,0 +1,58 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorResponse + /// information. + /// + public partial class ErrorResponseException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + public ErrorResponseException() + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + public ErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ErrorSubCode.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ErrorSubCode.cs new file mode 100644 index 000000000000..001c85c54e40 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ErrorSubCode.cs @@ -0,0 +1,27 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + + /// + /// Defines values for ErrorSubCode. + /// + public static class ErrorSubCode + { + public const string UnexpectedError = "UnexpectedError"; + public const string ResourceError = "ResourceError"; + public const string NotImplemented = "NotImplemented"; + public const string ParameterMissing = "ParameterMissing"; + public const string ParameterInvalidValue = "ParameterInvalidValue"; + public const string HttpNotAllowed = "HttpNotAllowed"; + public const string Blocked = "Blocked"; + public const string AuthorizationMissing = "AuthorizationMissing"; + public const string AuthorizationRedundancy = "AuthorizationRedundancy"; + public const string AuthorizationDisabled = "AuthorizationDisabled"; + public const string AuthorizationExpired = "AuthorizationExpired"; + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/GeoCoordinates.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/GeoCoordinates.cs new file mode 100644 index 000000000000..7a4410124827 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/GeoCoordinates.cs @@ -0,0 +1,64 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class GeoCoordinates + { + /// + /// Initializes a new instance of the GeoCoordinates class. + /// + public GeoCoordinates() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoCoordinates class. + /// + public GeoCoordinates(double latitude, double longitude, double? elevation = default(double?)) + { + Latitude = latitude; + Longitude = longitude; + Elevation = elevation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "latitude")] + public double Latitude { get; set; } + + /// + /// + [JsonProperty(PropertyName = "longitude")] + public double Longitude { get; set; } + + /// + /// + [JsonProperty(PropertyName = "elevation")] + public double? Elevation { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Identifiable.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Identifiable.cs new file mode 100644 index 000000000000..91c5033f799f --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Identifiable.cs @@ -0,0 +1,47 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines the identity of a resource. + /// + public partial class Identifiable : ResponseBase + { + /// + /// Initializes a new instance of the Identifiable class. + /// + public Identifiable() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Identifiable class. + /// + /// A String identifier. + public Identifiable(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a String identifier. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Intangible.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Intangible.cs new file mode 100644 index 000000000000..0e59d0e61155 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Intangible.cs @@ -0,0 +1,64 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A utility class that serves as the umbrella for a number of + /// 'intangible' things such as quantities, structured values, etc. + /// + public partial class Intangible : Thing + { + /// + /// Initializes a new instance of the Intangible class. + /// + public Intangible() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Intangible class. + /// + /// A String identifier. + /// The URL that returns this resource. + /// The URL to Bing's search result for this + /// item. + /// The name of the thing represented by this + /// object. + /// The URL to get more information about the thing + /// represented by this object. + /// Additional information about + /// the entity such as hints that you can use to determine the entity's + /// type. To determine the entity's type, use the entityScenario and + /// entityTypeHint fields. + public Intangible(string id = default(string), string readLink = default(string), string webSearchUrl = default(string), IList potentialAction = default(IList), IList immediateAction = default(IList), string preferredClickthroughUrl = default(string), string adaptiveCard = default(string), string name = default(string), string url = default(string), EntitiesEntityPresentationInfo entityPresentationInfo = default(EntitiesEntityPresentationInfo)) + : base(id, readLink, webSearchUrl, potentialAction, immediateAction, preferredClickthroughUrl, adaptiveCard, name, url, entityPresentationInfo) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Place.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Place.cs new file mode 100644 index 000000000000..f6c37ff3aa72 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Place.cs @@ -0,0 +1,106 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Defines information about a local entity, such as a restaurant or + /// hotel. + /// + public partial class Place : Thing + { + /// + /// Initializes a new instance of the Place class. + /// + public Place() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Place class. + /// + /// A String identifier. + /// The URL that returns this resource. + /// The URL to Bing's search result for this + /// item. + /// The name of the thing represented by this + /// object. + /// The URL to get more information about the thing + /// represented by this object. + /// Additional information about + /// the entity such as hints that you can use to determine the entity's + /// type. To determine the entity's type, use the entityScenario and + /// entityTypeHint fields. + /// The postal address of where the entity is + /// located + /// The entity's telephone number + public Place(string id = default(string), string readLink = default(string), string webSearchUrl = default(string), IList potentialAction = default(IList), IList immediateAction = default(IList), string preferredClickthroughUrl = default(string), string adaptiveCard = default(string), string name = default(string), string url = default(string), EntitiesEntityPresentationInfo entityPresentationInfo = default(EntitiesEntityPresentationInfo), GeoCoordinates geo = default(GeoCoordinates), GeoCoordinates routablePoint = default(GeoCoordinates), PostalAddress address = default(PostalAddress), string telephone = default(string)) + : base(id, readLink, webSearchUrl, potentialAction, immediateAction, preferredClickthroughUrl, adaptiveCard, name, url, entityPresentationInfo) + { + Geo = geo; + RoutablePoint = routablePoint; + Address = address; + Telephone = telephone; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "geo")] + public GeoCoordinates Geo { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "routablePoint")] + public GeoCoordinates RoutablePoint { get; private set; } + + /// + /// Gets the postal address of where the entity is located + /// + [JsonProperty(PropertyName = "address")] + public PostalAddress Address { get; private set; } + + /// + /// Gets the entity's telephone number + /// + [JsonProperty(PropertyName = "telephone")] + public string Telephone { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Geo != null) + { + Geo.Validate(); + } + if (RoutablePoint != null) + { + RoutablePoint.Validate(); + } + if (Address != null) + { + Address.Validate(); + } + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Places.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Places.cs new file mode 100644 index 000000000000..876dc4deb36c --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Places.cs @@ -0,0 +1,84 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Defines a local entity answer. + /// + public partial class Places : SearchResultsAnswer + { + /// + /// Initializes a new instance of the Places class. + /// + public Places() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Places class. + /// + /// A list of local entities, such as restaurants + /// or hotels. + /// A String identifier. + /// The URL that returns this resource. + /// The URL to Bing's search result for this + /// item. + /// 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. + public Places(IList value, string id = default(string), string readLink = default(string), string webSearchUrl = default(string), IList potentialAction = default(IList), IList immediateAction = default(IList), string preferredClickthroughUrl = default(string), string adaptiveCard = default(string), QueryContext queryContext = default(QueryContext), long? totalEstimatedMatches = default(long?), bool? isFamilyFriendly = default(bool?)) + : base(id, readLink, webSearchUrl, potentialAction, immediateAction, preferredClickthroughUrl, adaptiveCard, queryContext, totalEstimatedMatches, isFamilyFriendly) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list of local entities, such as restaurants or + /// hotels. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Value == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + } + if (Value != null) + { + foreach (var element in Value) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/PostalAddress.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/PostalAddress.cs new file mode 100644 index 000000000000..6d57aba6b46f --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/PostalAddress.cs @@ -0,0 +1,182 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Defines a postal address. + /// + public partial class PostalAddress : StructuredValue + { + /// + /// Initializes a new instance of the PostalAddress class. + /// + public PostalAddress() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PostalAddress class. + /// + /// A String identifier. + /// The URL that returns this resource. + /// The URL to Bing's search result for this + /// item. + /// The name of the thing represented by this + /// object. + /// The URL to get more information about the thing + /// represented by this object. + /// Additional information about + /// the entity such as hints that you can use to determine the entity's + /// type. To determine the entity's type, use the entityScenario and + /// entityTypeHint fields. + /// The city where the street address is + /// located. For example, Seattle. + /// The state or province code where the + /// street address is located. This could be the two-letter code. For + /// example, WA, or the full name , Washington. + /// The zip code or postal code where the + /// street address is located. For example, 98052. + /// The country/region where the street + /// address is located. This could be the two-letter ISO code. For + /// example, US, or the full name, United States. + /// The two letter ISO code of this countr. + /// For example, US. + /// The neighborhood where the street + /// address is located. For example, Westlake. + /// Region Abbreviation. For + /// example, WA. + /// The complete address. For example, 2100 Westlake + /// Ave N, Bellevue, WA 98052. + public PostalAddress(string id = default(string), string readLink = default(string), string webSearchUrl = default(string), IList potentialAction = default(IList), IList immediateAction = default(IList), string preferredClickthroughUrl = default(string), string adaptiveCard = default(string), string name = default(string), string url = default(string), EntitiesEntityPresentationInfo entityPresentationInfo = default(EntitiesEntityPresentationInfo), string streetAddress = default(string), string addressLocality = default(string), string addressSubregion = default(string), string addressRegion = default(string), string postalCode = default(string), string postOfficeBoxNumber = default(string), string addressCountry = default(string), string countryIso = default(string), string neighborhood = default(string), string addressRegionAbbreviation = default(string), string text = default(string), string houseNumber = default(string), string streetName = default(string), string formattingRuleId = default(string)) + : base(id, readLink, webSearchUrl, potentialAction, immediateAction, preferredClickthroughUrl, adaptiveCard, name, url, entityPresentationInfo) + { + StreetAddress = streetAddress; + AddressLocality = addressLocality; + AddressSubregion = addressSubregion; + AddressRegion = addressRegion; + PostalCode = postalCode; + PostOfficeBoxNumber = postOfficeBoxNumber; + AddressCountry = addressCountry; + CountryIso = countryIso; + Neighborhood = neighborhood; + AddressRegionAbbreviation = addressRegionAbbreviation; + Text = text; + HouseNumber = houseNumber; + StreetName = streetName; + FormattingRuleId = formattingRuleId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "streetAddress")] + public string StreetAddress { get; private set; } + + /// + /// Gets the city where the street address is located. For example, + /// Seattle. + /// + [JsonProperty(PropertyName = "addressLocality")] + public string AddressLocality { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "addressSubregion")] + public string AddressSubregion { get; private set; } + + /// + /// Gets the state or province code where the street address is + /// located. This could be the two-letter code. For example, WA, or the + /// full name , Washington. + /// + [JsonProperty(PropertyName = "addressRegion")] + public string AddressRegion { get; private set; } + + /// + /// Gets the zip code or postal code where the street address is + /// located. For example, 98052. + /// + [JsonProperty(PropertyName = "postalCode")] + public string PostalCode { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "postOfficeBoxNumber")] + public string PostOfficeBoxNumber { get; private set; } + + /// + /// Gets the country/region where the street address is located. This + /// could be the two-letter ISO code. For example, US, or the full + /// name, United States. + /// + [JsonProperty(PropertyName = "addressCountry")] + public string AddressCountry { get; private set; } + + /// + /// Gets the two letter ISO code of this countr. For example, US. + /// + [JsonProperty(PropertyName = "countryIso")] + public string CountryIso { get; private set; } + + /// + /// Gets the neighborhood where the street address is located. For + /// example, Westlake. + /// + [JsonProperty(PropertyName = "neighborhood")] + public string Neighborhood { get; private set; } + + /// + /// Gets region Abbreviation. For example, WA. + /// + [JsonProperty(PropertyName = "addressRegionAbbreviation")] + public string AddressRegionAbbreviation { get; private set; } + + /// + /// Gets the complete address. For example, 2100 Westlake Ave N, + /// Bellevue, WA 98052. + /// + [JsonProperty(PropertyName = "text")] + public string Text { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "houseNumber")] + public string HouseNumber { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "streetName")] + public string StreetName { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "formattingRuleId")] + public string FormattingRuleId { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/QueryContext.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/QueryContext.cs new file mode 100644 index 000000000000..c0bb97685f81 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/QueryContext.cs @@ -0,0 +1,156 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines the query context that Bing used for the request. + /// + public partial class QueryContext + { + /// + /// Initializes a new instance of the QueryContext class. + /// + public QueryContext() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QueryContext class. + /// + /// The query string as specified in the + /// request. + /// The query string used by Bing to perform + /// the query. Bing uses the altered query string if the original query + /// string contained spelling mistakes. For example, if the query + /// string is "saling downwind", the altered query string will be + /// "sailing downwind". This field is included only if the original + /// query string contains a spelling mistake. + /// AlteredQuery that is formatted + /// for display purpose. The query string in the AlterationDisplayQuery + /// can be html-escaped and can contain hit-highlighting + /// characters + /// The query string to use to + /// force Bing to use the original string. For example, if the query + /// string is "saling downwind", the override query string will be + /// "+saling downwind". Remember to encode the query string which + /// results in "%2Bsaling+downwind". This field is included only if the + /// original query string contains a spelling mistake. + /// A Boolean value that indicates whether + /// the specified query has adult intent. The value is true if the + /// query has adult intent; otherwise, false. + /// A Boolean value that indicates + /// whether Bing requires the user's location to provide accurate + /// results. If you specified the user's location by using the + /// X-MSEdge-ClientIP and X-Search-Location headers, you can ignore + /// this field. For location aware queries, such as "today's weather" + /// or "restaurants near me" that need the user's location to provide + /// accurate results, this field is set to true. For location aware + /// queries that include the location (for example, "Seattle weather"), + /// this field is set to false. This field is also set to false for + /// queries that are not location aware, such as "best + /// sellers". + public QueryContext(string originalQuery, string alteredQuery = default(string), string alterationDisplayQuery = default(string), string alterationOverrideQuery = default(string), bool? adultIntent = default(bool?), bool? askUserForLocation = default(bool?), bool? isTransactional = default(bool?)) + { + OriginalQuery = originalQuery; + AlteredQuery = alteredQuery; + AlterationDisplayQuery = alterationDisplayQuery; + AlterationOverrideQuery = alterationOverrideQuery; + AdultIntent = adultIntent; + AskUserForLocation = askUserForLocation; + IsTransactional = isTransactional; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the query string as specified in the request. + /// + [JsonProperty(PropertyName = "originalQuery")] + public string OriginalQuery { get; set; } + + /// + /// Gets the query string used by Bing to perform the query. Bing uses + /// the altered query string if the original query string contained + /// spelling mistakes. For example, if the query string is "saling + /// downwind", the altered query string will be "sailing downwind". + /// This field is included only if the original query string contains a + /// spelling mistake. + /// + [JsonProperty(PropertyName = "alteredQuery")] + public string AlteredQuery { get; private set; } + + /// + /// Gets alteredQuery that is formatted for display purpose. The query + /// string in the AlterationDisplayQuery can be html-escaped and can + /// contain hit-highlighting characters + /// + [JsonProperty(PropertyName = "alterationDisplayQuery")] + public string AlterationDisplayQuery { get; private set; } + + /// + /// Gets the query string to use to force Bing to use the original + /// string. For example, if the query string is "saling downwind", the + /// override query string will be "+saling downwind". Remember to + /// encode the query string which results in "%2Bsaling+downwind". This + /// field is included only if the original query string contains a + /// spelling mistake. + /// + [JsonProperty(PropertyName = "alterationOverrideQuery")] + public string AlterationOverrideQuery { get; private set; } + + /// + /// Gets a Boolean value that indicates whether the specified query has + /// adult intent. The value is true if the query has adult intent; + /// otherwise, false. + /// + [JsonProperty(PropertyName = "adultIntent")] + public bool? AdultIntent { get; private set; } + + /// + /// Gets a Boolean value that indicates whether Bing requires the + /// user's location to provide accurate results. If you specified the + /// user's location by using the X-MSEdge-ClientIP and + /// X-Search-Location headers, you can ignore this field. For location + /// aware queries, such as "today's weather" or "restaurants near me" + /// that need the user's location to provide accurate results, this + /// field is set to true. For location aware queries that include the + /// location (for example, "Seattle weather"), this field is set to + /// false. This field is also set to false for queries that are not + /// location aware, such as "best sellers". + /// + [JsonProperty(PropertyName = "askUserForLocation")] + public bool? AskUserForLocation { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "isTransactional")] + public bool? IsTransactional { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (OriginalQuery == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "OriginalQuery"); + } + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Response.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Response.cs new file mode 100644 index 000000000000..bad031335594 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Response.cs @@ -0,0 +1,85 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Defines a response. All schemas that return at the root of the response + /// must inherit from this object. + /// + public partial class Response : Identifiable + { + /// + /// Initializes a new instance of the Response class. + /// + public Response() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Response class. + /// + /// A String identifier. + /// The URL that returns this resource. + /// The URL to Bing's search result for this + /// item. + public Response(string id = default(string), string readLink = default(string), string webSearchUrl = default(string), IList potentialAction = default(IList), IList immediateAction = default(IList), string preferredClickthroughUrl = default(string), string adaptiveCard = default(string)) + : base(id) + { + ReadLink = readLink; + WebSearchUrl = webSearchUrl; + PotentialAction = potentialAction; + ImmediateAction = immediateAction; + PreferredClickthroughUrl = preferredClickthroughUrl; + AdaptiveCard = adaptiveCard; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the URL that returns this resource. + /// + [JsonProperty(PropertyName = "readLink")] + public string ReadLink { get; private set; } + + /// + /// Gets the URL to Bing's search result for this item. + /// + [JsonProperty(PropertyName = "webSearchUrl")] + public string WebSearchUrl { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "potentialAction")] + public IList PotentialAction { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "immediateAction")] + public IList ImmediateAction { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "preferredClickthroughUrl")] + public string PreferredClickthroughUrl { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "adaptiveCard")] + public string AdaptiveCard { get; private set; } + + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ResponseBase.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ResponseBase.cs new file mode 100644 index 000000000000..de26850c684c --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ResponseBase.cs @@ -0,0 +1,31 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using System.Linq; + + /// + /// Response base + /// + public partial class ResponseBase + { + /// + /// Initializes a new instance of the ResponseBase class. + /// + public ResponseBase() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ResponseFormat.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ResponseFormat.cs new file mode 100644 index 000000000000..8ed6e10f80fa --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/ResponseFormat.cs @@ -0,0 +1,18 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + + /// + /// Defines values for ResponseFormat. + /// + public static class ResponseFormat + { + public const string Json = "Json"; + public const string JsonLd = "JsonLd"; + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/SafeSearch.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/SafeSearch.cs new file mode 100644 index 000000000000..1bd05e9f1b59 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/SafeSearch.cs @@ -0,0 +1,19 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + + /// + /// Defines values for SafeSearch. + /// + public static class SafeSearch + { + public const string Off = "Off"; + public const string Moderate = "Moderate"; + public const string Strict = "Strict"; + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/SearchAction.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/SearchAction.cs new file mode 100644 index 000000000000..661656a268ea --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/SearchAction.cs @@ -0,0 +1,98 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class SearchAction : Action + { + /// + /// Initializes a new instance of the SearchAction class. + /// + public SearchAction() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchAction class. + /// + /// A String identifier. + /// The URL that returns this resource. + /// The URL to Bing's search result for this + /// item. + /// The name of the thing represented by this + /// object. + /// The URL to get more information about the thing + /// represented by this object. + /// Additional information about + /// the entity such as hints that you can use to determine the entity's + /// type. To determine the entity's type, use the entityScenario and + /// entityTypeHint fields. + /// The URL to a thumbnail of the + /// item. + /// For internal use only. + /// For internal use only. + /// The source of the creative work. + /// Text content of this creative work + /// The result produced in the action. + /// A display name for the action. + /// A Boolean representing whether this + /// result is the top action. + /// Use this URL to get additional data to + /// determine how to take the appropriate action. For example, the + /// serviceUrl might return JSON along with an image URL. + public SearchAction(string id = default(string), string readLink = default(string), string webSearchUrl = default(string), IList potentialAction = default(IList), IList immediateAction = default(IList), string preferredClickthroughUrl = default(string), string adaptiveCard = default(string), string name = default(string), string url = default(string), EntitiesEntityPresentationInfo entityPresentationInfo = default(EntitiesEntityPresentationInfo), string thumbnailUrl = default(string), IList about = default(IList), IList mentions = default(IList), IList provider = default(IList), Thing creator = default(Thing), string text = default(string), string discussionUrl = default(string), int? commentCount = default(int?), Thing mainEntity = default(Thing), string headLine = default(string), Thing copyrightHolder = default(Thing), int? copyrightYear = default(int?), string disclaimer = default(string), bool? isAccessibleForFree = default(bool?), IList genre = default(IList), bool? isFamilyFriendly = default(bool?), IList location = default(IList), IList result = default(IList), string displayName = default(string), bool? isTopAction = default(bool?), string serviceUrl = default(string), string displayText = default(string), string query = default(string), IList richContent = default(IList), string formattingRuleId = default(string)) + : base(id, readLink, webSearchUrl, potentialAction, immediateAction, preferredClickthroughUrl, adaptiveCard, name, url, entityPresentationInfo, thumbnailUrl, about, mentions, provider, creator, text, discussionUrl, commentCount, mainEntity, headLine, copyrightHolder, copyrightYear, disclaimer, isAccessibleForFree, genre, isFamilyFriendly, location, result, displayName, isTopAction, serviceUrl) + { + DisplayText = displayText; + Query = query; + RichContent = richContent; + FormattingRuleId = formattingRuleId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "displayText")] + public string DisplayText { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "query")] + public string Query { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "richContent")] + public IList RichContent { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "formattingRuleId")] + public string FormattingRuleId { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/SearchResponse.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/SearchResponse.cs new file mode 100644 index 000000000000..7581718c3378 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/SearchResponse.cs @@ -0,0 +1,106 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Defines the top-level object that the response includes when the + /// request succeeds. + /// + public partial class SearchResponse : Response + { + /// + /// Initializes a new instance of the SearchResponse class. + /// + public SearchResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchResponse class. + /// + /// A String identifier. + /// The URL that returns this resource. + /// The URL to Bing's search result for this + /// item. + /// An object that contains the query string + /// that Bing used for the request. This object contains the query + /// string as entered by the user. It may also contain an altered query + /// string that Bing used for the query if the query string contained a + /// spelling mistake. + /// A list of local entities such as restaurants + /// or hotels that are relevant to the query. + public SearchResponse(string id = default(string), string readLink = default(string), string webSearchUrl = default(string), IList potentialAction = default(IList), IList immediateAction = default(IList), string preferredClickthroughUrl = default(string), string adaptiveCard = default(string), QueryContext queryContext = default(QueryContext), Places places = default(Places), SearchResultsAnswer lottery = default(SearchResultsAnswer), double? searchResultsConfidenceScore = default(double?)) + : base(id, readLink, webSearchUrl, potentialAction, immediateAction, preferredClickthroughUrl, adaptiveCard) + { + QueryContext = queryContext; + Places = places; + Lottery = lottery; + SearchResultsConfidenceScore = searchResultsConfidenceScore; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets an object that contains the query string that Bing used for + /// the request. This object contains the query string as entered by + /// the user. It may also contain an altered query string that Bing + /// used for the query if the query string contained a spelling + /// mistake. + /// + [JsonProperty(PropertyName = "queryContext")] + public QueryContext QueryContext { get; private set; } + + /// + /// Gets a list of local entities such as restaurants or hotels that + /// are relevant to the query. + /// + [JsonProperty(PropertyName = "places")] + public Places Places { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "lottery")] + public SearchResultsAnswer Lottery { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "searchResultsConfidenceScore")] + public double? SearchResultsConfidenceScore { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (QueryContext != null) + { + QueryContext.Validate(); + } + if (Places != null) + { + Places.Validate(); + } + if (Lottery != null) + { + Lottery.Validate(); + } + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/SearchResultsAnswer.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/SearchResultsAnswer.cs new file mode 100644 index 000000000000..5e2d98b59eed --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/SearchResultsAnswer.cs @@ -0,0 +1,83 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Defines a search result answer. + /// + public partial class SearchResultsAnswer : Answer + { + /// + /// Initializes a new instance of the SearchResultsAnswer class. + /// + public SearchResultsAnswer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchResultsAnswer class. + /// + /// A String identifier. + /// The URL that returns this resource. + /// The URL to Bing's search result for this + /// item. + /// 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. + public SearchResultsAnswer(string id = default(string), string readLink = default(string), string webSearchUrl = default(string), IList potentialAction = default(IList), IList immediateAction = default(IList), string preferredClickthroughUrl = default(string), string adaptiveCard = default(string), QueryContext queryContext = default(QueryContext), long? totalEstimatedMatches = default(long?), bool? isFamilyFriendly = default(bool?)) + : base(id, readLink, webSearchUrl, potentialAction, immediateAction, preferredClickthroughUrl, adaptiveCard) + { + QueryContext = queryContext; + TotalEstimatedMatches = totalEstimatedMatches; + IsFamilyFriendly = isFamilyFriendly; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "queryContext")] + public QueryContext QueryContext { get; private set; } + + /// + /// Gets 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. + /// + [JsonProperty(PropertyName = "totalEstimatedMatches")] + public long? TotalEstimatedMatches { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "isFamilyFriendly")] + public bool? IsFamilyFriendly { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (QueryContext != null) + { + QueryContext.Validate(); + } + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/StructuredValue.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/StructuredValue.cs new file mode 100644 index 000000000000..08edf0685e5a --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/StructuredValue.cs @@ -0,0 +1,60 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class StructuredValue : Intangible + { + /// + /// Initializes a new instance of the StructuredValue class. + /// + public StructuredValue() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StructuredValue class. + /// + /// A String identifier. + /// The URL that returns this resource. + /// The URL to Bing's search result for this + /// item. + /// The name of the thing represented by this + /// object. + /// The URL to get more information about the thing + /// represented by this object. + /// Additional information about + /// the entity such as hints that you can use to determine the entity's + /// type. To determine the entity's type, use the entityScenario and + /// entityTypeHint fields. + public StructuredValue(string id = default(string), string readLink = default(string), string webSearchUrl = default(string), IList potentialAction = default(IList), IList immediateAction = default(IList), string preferredClickthroughUrl = default(string), string adaptiveCard = default(string), string name = default(string), string url = default(string), EntitiesEntityPresentationInfo entityPresentationInfo = default(EntitiesEntityPresentationInfo)) + : base(id, readLink, webSearchUrl, potentialAction, immediateAction, preferredClickthroughUrl, adaptiveCard, name, url, entityPresentationInfo) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Thing.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Thing.cs new file mode 100644 index 000000000000..ce3f7998b81d --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/Models/Thing.cs @@ -0,0 +1,91 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Defines a thing. + /// + public partial class Thing : Response + { + /// + /// Initializes a new instance of the Thing class. + /// + public Thing() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Thing class. + /// + /// A String identifier. + /// The URL that returns this resource. + /// The URL to Bing's search result for this + /// item. + /// The name of the thing represented by this + /// object. + /// The URL to get more information about the thing + /// represented by this object. + /// Additional information about + /// the entity such as hints that you can use to determine the entity's + /// type. To determine the entity's type, use the entityScenario and + /// entityTypeHint fields. + public Thing(string id = default(string), string readLink = default(string), string webSearchUrl = default(string), IList potentialAction = default(IList), IList immediateAction = default(IList), string preferredClickthroughUrl = default(string), string adaptiveCard = default(string), string name = default(string), string url = default(string), EntitiesEntityPresentationInfo entityPresentationInfo = default(EntitiesEntityPresentationInfo)) + : base(id, readLink, webSearchUrl, potentialAction, immediateAction, preferredClickthroughUrl, adaptiveCard) + { + Name = name; + Url = url; + EntityPresentationInfo = entityPresentationInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the thing represented by this object. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the URL to get more information about the thing represented by + /// this object. + /// + [JsonProperty(PropertyName = "url")] + public string Url { get; private set; } + + /// + /// Gets additional information about the entity such as hints that you + /// can use to determine the entity's type. To determine the entity's + /// type, use the entityScenario and entityTypeHint fields. + /// + [JsonProperty(PropertyName = "entityPresentationInfo")] + public EntitiesEntityPresentationInfo EntityPresentationInfo { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (EntityPresentationInfo != null) + { + EntityPresentationInfo.Validate(); + } + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/SdkInfo_LocalSearchClient.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/SdkInfo_LocalSearchClient.cs new file mode 100644 index 000000000000..8cad041464e1 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Generated/LocalSearch/SdkInfo_LocalSearchClient.cs @@ -0,0 +1,38 @@ + +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Search.LocalSearch +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_LocalSearchClient + { + get + { + return new Tuple[] + { + new Tuple("LocalSearchClient", "Local", "1.0"), + }.AsEnumerable(); + } + } + // BEGIN: Code Generation Metadata Section + public static readonly String AutoRestVersion = "latest"; + public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; + public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/LocalSearch/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\git_repositories\\azure-sdk-for-net\\src\\SDKs"; + public static readonly String GithubForkName = "Azure"; + public static readonly String GithubBranchName = "master"; + public static readonly String GithubCommidId = "73d0c3c4a4bcd3cb6e58ab0cc5f61599e47806bb"; + public static readonly String CodeGenerationErrors = ""; + public static readonly String GithubRepoName = "azure-rest-api-specs"; + // END: Code Generation Metadata Section + } +} + diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Properties/AssemblyInfo.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..110e8036a684 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/Properties/AssemblyInfo.cs @@ -0,0 +1,26 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("BingLocalSearch")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("BingLocalSearch")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("e9cfaa11-adcb-4ce6-8478-ecc4753e7e8f")] + +[assembly: AssemblyVersion("0.9.0.0")] +[assembly: AssemblyFileVersion("0.9.0.0")] diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/generate.ps1 b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/generate.ps1 new file mode 100644 index 000000000000..6241277f4641 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingLocalSearch/BingLocalSearch/generate.ps1 @@ -0,0 +1 @@ +Start-AutoRestCodeGeneration -ResourceProvider "cognitiveservices/data-plane/LocalSearch" -AutoRestVersion "latest" diff --git a/src/SDKs/_metadata/cognitiveservices_data-plane_LocalSearch.txt b/src/SDKs/_metadata/cognitiveservices_data-plane_LocalSearch.txt new file mode 100644 index 000000000000..a485a68de77d --- /dev/null +++ b/src/SDKs/_metadata/cognitiveservices_data-plane_LocalSearch.txt @@ -0,0 +1,14 @@ +Installing AutoRest version: latest +AutoRest installed successfully. +Commencing code generation +Generating CSharp code +Executing AutoRest command +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/LocalSearch/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\git_repositories\azure-sdk-for-net\src\SDKs +2018-10-30 21:47:17 UTC +Azure-rest-api-specs repository information +GitHub fork: Azure +Branch: master +Commit: 73d0c3c4a4bcd3cb6e58ab0cc5f61599e47806bb +AutoRest information +Requested version: latest +Bootstrapper version: autorest@2.0.4283