diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch.Tests/CustomImageSearchTests.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch.Tests/CustomImageSearchTests.cs index e2f46cb23aa0..9d769f1ae2fe 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch.Tests/CustomImageSearchTests.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch.Tests/CustomImageSearchTests.cs @@ -19,8 +19,8 @@ public void CustomImageSearch() { HttpMockServer.Initialize(this.GetType().FullName, "CustomImageSearch"); - var client = new CustomImageSearchAPI(new ApiKeyServiceClientCredentials(SubscriptionKey), HttpMockServer.CreateInstance()); - var resp = client.CustomInstance.ImageSearchAsync(query: "tom cruise", customConfig: 0).Result; + var client = new CustomImageSearchClient(new ApiKeyServiceClientCredentials(SubscriptionKey), HttpMockServer.CreateInstance()); + var resp = client.CustomInstance.ImageSearchAsync(query: "tom cruise", customConfig: "0").Result; Assert.NotNull(resp); Assert.NotNull(resp.Value); diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/CustomImageSearchAPI.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/CustomImageSearchClient.cs similarity index 72% rename from src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/CustomImageSearchAPI.cs rename to src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/CustomImageSearchClient.cs index 1340755ac0f8..802ae73854d5 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/CustomImageSearchAPI.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/CustomImageSearchClient.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.CognitiveServices.Search.CustomImageSearch /// Bing and get back image search results customized to meet your custom /// search definition. /// - public partial class CustomImageSearchAPI : ServiceClient, ICustomImageSearchAPI + public partial class CustomImageSearchClient : ServiceClient, ICustomImageSearchClient { /// /// The base URI of the service. @@ -48,18 +48,31 @@ public partial class CustomImageSearchAPI : ServiceClient, public virtual ICustomInstance CustomInstance { get; private set; } /// - /// Initializes a new instance of the CustomImageSearchAPI class. + /// Initializes a new instance of the CustomImageSearchClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling CustomImageSearchClient.Dispose(). False: will not dispose provided httpClient + protected CustomImageSearchClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the CustomImageSearchClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected CustomImageSearchAPI(params DelegatingHandler[] handlers) : base(handlers) + protected CustomImageSearchClient(params DelegatingHandler[] handlers) : base(handlers) { Initialize(); } /// - /// Initializes a new instance of the CustomImageSearchAPI class. + /// Initializes a new instance of the CustomImageSearchClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -67,13 +80,13 @@ protected CustomImageSearchAPI(params DelegatingHandler[] handlers) : base(handl /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected CustomImageSearchAPI(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected CustomImageSearchClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) { Initialize(); } /// - /// Initializes a new instance of the CustomImageSearchAPI class. + /// Initializes a new instance of the CustomImageSearchClient class. /// /// /// Optional. The base URI of the service. @@ -84,7 +97,7 @@ protected CustomImageSearchAPI(HttpClientHandler rootHandler, params DelegatingH /// /// Thrown when a required parameter is null /// - protected CustomImageSearchAPI(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected CustomImageSearchClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -94,7 +107,7 @@ protected CustomImageSearchAPI(System.Uri baseUri, params DelegatingHandler[] ha } /// - /// Initializes a new instance of the CustomImageSearchAPI class. + /// Initializes a new instance of the CustomImageSearchClient class. /// /// /// Optional. The base URI of the service. @@ -108,7 +121,7 @@ protected CustomImageSearchAPI(System.Uri baseUri, params DelegatingHandler[] ha /// /// Thrown when a required parameter is null /// - protected CustomImageSearchAPI(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected CustomImageSearchClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -118,7 +131,7 @@ protected CustomImageSearchAPI(System.Uri baseUri, HttpClientHandler rootHandler } /// - /// Initializes a new instance of the CustomImageSearchAPI class. + /// Initializes a new instance of the CustomImageSearchClient class. /// /// /// Required. Subscription credentials which uniquely identify client subscription. @@ -129,7 +142,34 @@ protected CustomImageSearchAPI(System.Uri baseUri, HttpClientHandler rootHandler /// /// Thrown when a required parameter is null /// - public CustomImageSearchAPI(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public CustomImageSearchClient(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 CustomImageSearchClient class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling CustomImageSearchClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public CustomImageSearchClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { @@ -143,7 +183,7 @@ public CustomImageSearchAPI(ServiceClientCredentials credentials, params Delegat } /// - /// Initializes a new instance of the CustomImageSearchAPI class. + /// Initializes a new instance of the CustomImageSearchClient class. /// /// /// Required. Subscription credentials which uniquely identify client subscription. @@ -157,7 +197,7 @@ public CustomImageSearchAPI(ServiceClientCredentials credentials, params Delegat /// /// Thrown when a required parameter is null /// - public CustomImageSearchAPI(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public CustomImageSearchClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { @@ -171,7 +211,7 @@ public CustomImageSearchAPI(ServiceClientCredentials credentials, HttpClientHand } /// - /// Initializes a new instance of the CustomImageSearchAPI class. + /// Initializes a new instance of the CustomImageSearchClient class. /// /// /// Optional. The base URI of the service. @@ -185,7 +225,7 @@ public CustomImageSearchAPI(ServiceClientCredentials credentials, HttpClientHand /// /// Thrown when a required parameter is null /// - public CustomImageSearchAPI(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public CustomImageSearchClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -204,7 +244,7 @@ public CustomImageSearchAPI(System.Uri baseUri, ServiceClientCredentials credent } /// - /// Initializes a new instance of the CustomImageSearchAPI class. + /// Initializes a new instance of the CustomImageSearchClient class. /// /// /// Optional. The base URI of the service. @@ -221,7 +261,7 @@ public CustomImageSearchAPI(System.Uri baseUri, ServiceClientCredentials credent /// /// Thrown when a required parameter is null /// - public CustomImageSearchAPI(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public CustomImageSearchClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/CustomInstance.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/CustomInstance.cs index d04642a54a8f..4c7f87135a3a 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/CustomInstance.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/CustomInstance.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.CognitiveServices.Search.CustomImageSearch /// /// CustomInstance operations. /// - public partial class CustomInstance : IServiceOperations, ICustomInstance + public partial class CustomInstance : IServiceOperations, ICustomInstance { /// /// Initializes a new instance of the CustomInstance class. @@ -32,7 +32,7 @@ public partial class CustomInstance : IServiceOperations, /// /// Thrown when a required parameter is null /// - public CustomInstance(CustomImageSearchAPI client) + public CustomInstance(CustomImageSearchClient client) { if (client == null) { @@ -42,9 +42,9 @@ public CustomInstance(CustomImageSearchAPI client) } /// - /// Gets a reference to the CustomImageSearchAPI + /// Gets a reference to the CustomImageSearchClient /// - public CustomImageSearchAPI Client { get; private set; } + public CustomImageSearchClient Client { get; private set; } /// /// The Custom Image Search API lets you send an image search query to Bing and @@ -425,11 +425,11 @@ public CustomInstance(CustomImageSearchAPI client) /// /// A response object containing the response body and response headers. /// - public async Task> ImageSearchWithHttpMessagesAsync(long customConfig, string query, string acceptLanguage = default(string), string userAgent = default(string), string clientId = default(string), string clientIp = default(string), string location = default(string), string aspect = default(string), string color = default(string), string countryCode = default(string), int? count = default(int?), string freshness = default(string), int? height = default(int?), string id = default(string), string imageContent = default(string), string imageType = default(string), string license = default(string), string market = default(string), long? maxFileSize = default(long?), long? maxHeight = default(long?), long? maxWidth = default(long?), long? minFileSize = default(long?), long? minHeight = default(long?), long? minWidth = default(long?), long? offset = default(long?), string safeSearch = default(string), string size = default(string), string setLang = default(string), int? width = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ImageSearchWithHttpMessagesAsync(string customConfig, string query, string acceptLanguage = default(string), string userAgent = default(string), string clientId = default(string), string clientIp = default(string), string location = default(string), string aspect = default(string), string color = default(string), string countryCode = default(string), int? count = default(int?), string freshness = default(string), int? height = default(int?), string id = default(string), string imageContent = default(string), string imageType = default(string), string license = default(string), string market = default(string), long? maxFileSize = default(long?), long? maxHeight = default(long?), long? maxWidth = default(long?), long? minFileSize = default(long?), long? minHeight = default(long?), long? minWidth = default(long?), long? offset = default(long?), string safeSearch = default(string), string size = default(string), string setLang = default(string), int? width = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (customConfig < 0) + if (customConfig == null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "customConfig", 0); + throw new ValidationException(ValidationRules.CannotBeNull, "customConfig"); } if (query == null) { @@ -480,7 +480,10 @@ public CustomInstance(CustomImageSearchAPI client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "images/search").ToString(); List _queryParameters = new List(); - _queryParameters.Add(string.Format("customConfig={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(customConfig, Client.SerializationSettings).Trim('"')))); + if (customConfig != null) + { + _queryParameters.Add(string.Format("customConfig={0}", System.Uri.EscapeDataString(customConfig))); + } if (aspect != null) { _queryParameters.Add(string.Format("aspect={0}", System.Uri.EscapeDataString(aspect))); diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/CustomInstanceExtensions.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/CustomInstanceExtensions.cs index 5304ee306fbc..dd77376179ad 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/CustomInstanceExtensions.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/CustomInstanceExtensions.cs @@ -379,7 +379,7 @@ public static partial class CustomInstanceExtensions /// /// The cancellation token. /// - public static async Task ImageSearchAsync(this ICustomInstance operations, long customConfig, string query, string acceptLanguage = default(string), string userAgent = default(string), string clientId = default(string), string clientIp = default(string), string location = default(string), string aspect = default(string), string color = default(string), string countryCode = default(string), int? count = default(int?), string freshness = default(string), int? height = default(int?), string id = default(string), string imageContent = default(string), string imageType = default(string), string license = default(string), string market = default(string), long? maxFileSize = default(long?), long? maxHeight = default(long?), long? maxWidth = default(long?), long? minFileSize = default(long?), long? minHeight = default(long?), long? minWidth = default(long?), long? offset = default(long?), string safeSearch = default(string), string size = default(string), string setLang = default(string), int? width = default(int?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ImageSearchAsync(this ICustomInstance operations, string customConfig, string query, string acceptLanguage = default(string), string userAgent = default(string), string clientId = default(string), string clientIp = default(string), string location = default(string), string aspect = default(string), string color = default(string), string countryCode = default(string), int? count = default(int?), string freshness = default(string), int? height = default(int?), string id = default(string), string imageContent = default(string), string imageType = default(string), string license = default(string), string market = default(string), long? maxFileSize = default(long?), long? maxHeight = default(long?), long? maxWidth = default(long?), long? minFileSize = default(long?), long? minHeight = default(long?), long? minWidth = default(long?), long? offset = default(long?), string safeSearch = default(string), string size = default(string), string setLang = default(string), int? width = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ImageSearchWithHttpMessagesAsync(customConfig, query, acceptLanguage, userAgent, clientId, clientIp, location, aspect, color, countryCode, count, freshness, height, id, imageContent, imageType, license, market, maxFileSize, maxHeight, maxWidth, minFileSize, minHeight, minWidth, offset, safeSearch, size, setLang, width, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/ICustomImageSearchAPI.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/ICustomImageSearchClient.cs similarity index 94% rename from src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/ICustomImageSearchAPI.cs rename to src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/ICustomImageSearchClient.cs index c2351ec5b03f..3889ff36aa52 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/ICustomImageSearchAPI.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/ICustomImageSearchClient.cs @@ -15,7 +15,7 @@ namespace Microsoft.Azure.CognitiveServices.Search.CustomImageSearch /// Bing and get back image search results customized to meet your custom /// search definition. /// - public partial interface ICustomImageSearchAPI : System.IDisposable + public partial interface ICustomImageSearchClient : System.IDisposable { /// /// The base URI of the service. diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/ICustomInstance.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/ICustomInstance.cs index 7ccd31a8a22d..dd761ecafd7e 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/ICustomInstance.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/ICustomInstance.cs @@ -422,6 +422,6 @@ public partial interface ICustomInstance /// /// Thrown when a required parameter is null /// - Task> ImageSearchWithHttpMessagesAsync(long customConfig, string query, string acceptLanguage = default(string), string userAgent = default(string), string clientId = default(string), string clientIp = default(string), string location = default(string), string aspect = default(string), string color = default(string), string countryCode = default(string), int? count = default(int?), string freshness = default(string), int? height = default(int?), string id = default(string), string imageContent = default(string), string imageType = default(string), string license = default(string), string market = default(string), long? maxFileSize = default(long?), long? maxHeight = default(long?), long? maxWidth = default(long?), long? minFileSize = default(long?), long? minHeight = default(long?), long? minWidth = default(long?), long? offset = default(long?), string safeSearch = default(string), string size = default(string), string setLang = default(string), int? width = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ImageSearchWithHttpMessagesAsync(string customConfig, string query, string acceptLanguage = default(string), string userAgent = default(string), string clientId = default(string), string clientIp = default(string), string location = default(string), string aspect = default(string), string color = default(string), string countryCode = default(string), int? count = default(int?), string freshness = default(string), int? height = default(int?), string id = default(string), string imageContent = default(string), string imageType = default(string), string license = default(string), string market = default(string), long? maxFileSize = default(long?), long? maxHeight = default(long?), long? maxWidth = default(long?), long? minFileSize = default(long?), long? minHeight = default(long?), long? minWidth = default(long?), long? offset = default(long?), string safeSearch = default(string), string size = default(string), string setLang = default(string), int? width = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/SdkInfo_CustomImageSearchAPI.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/SdkInfo_CustomImageSearchClient.cs similarity index 90% rename from src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/SdkInfo_CustomImageSearchAPI.cs rename to src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/SdkInfo_CustomImageSearchClient.cs index f07941d910fb..aebced7e7e82 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/SdkInfo_CustomImageSearchAPI.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Generated/CustomImageSearch/SdkInfo_CustomImageSearchClient.cs @@ -13,13 +13,13 @@ namespace Microsoft.Azure.CognitiveServices.Search.CustomImageSearch internal static partial class SdkInfo { - public static IEnumerable> ApiInfo_CustomImageSearchAPI + public static IEnumerable> ApiInfo_CustomImageSearchClient { get { return new Tuple[] { - new Tuple("CustomImageSearchAPI", "CustomInstance", "1.0"), + new Tuple("CustomImageSearchClient", "CustomInstance", "1.0"), }.AsEnumerable(); } } diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Microsoft.Azure.CognitiveServices.Search.CustomImageSearch.csproj b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Microsoft.Azure.CognitiveServices.Search.CustomImageSearch.csproj index f23497e667d4..e011f53b7b55 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Microsoft.Azure.CognitiveServices.Search.CustomImageSearch.csproj +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Microsoft.Azure.CognitiveServices.Search.CustomImageSearch.csproj @@ -6,10 +6,13 @@ Microsoft.Azure.CognitiveServices.Search.CustomImageSearch This client library provides access to the Microsoft Cognitive Services Custom Image Search API. - 1.0.0 + 1.2.0 Microsoft.Azure.CognitiveServices.Search.CustomImageSearch Microsoft Cognitive Services;Cognitive Services;Cognitive Services SDK;CustomImageSearch API;BingImageCustomSearch API;REST HTTPclient;CustomImageSearchSDK;BingCustomImageSearchSDK;netcore451511 - This is a public release of the Cognitive Services Search SDK. Included with this release is support for Custom Image Search API. + + net452;netstandard1.4 diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Properties/AssemblyInfo.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Properties/AssemblyInfo.cs index e8cbcc70fde0..062433ae0e89 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Properties/AssemblyInfo.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomImageSearch/BingCustomImageSearch/Properties/AssemblyInfo.cs @@ -8,7 +8,7 @@ [assembly: AssemblyDescription("Provides API functions for consuming the Microsoft Azure Cognitive Services Custom Search API.")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] +[assembly: AssemblyFileVersion("1.2.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch.Tests/CustomSearchTests.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch.Tests/CustomSearchTests.cs index 53209d6ebd88..6ceee5c3dd04 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch.Tests/CustomSearchTests.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch.Tests/CustomSearchTests.cs @@ -20,7 +20,7 @@ public void CustomSearch() HttpMockServer.Initialize(this.GetType().FullName, "CustomSearch"); ICustomSearchAPI client = new CustomSearchAPI(new ApiKeyServiceClientCredentials(SubscriptionKey), HttpMockServer.CreateInstance()); - var resp = client.CustomInstance.SearchAsync(query: "tom cruise", customConfig: 0).Result; + var resp = client.CustomInstance.SearchAsync(query: "tom cruise", customConfig: "0").Result; Assert.NotNull(resp); Assert.NotNull(resp.WebPages); diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Generated/CustomSearch/CustomInstance.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Generated/CustomSearch/CustomInstance.cs index 4ad88b63ec10..96fb3cd450c6 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Generated/CustomSearch/CustomInstance.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Generated/CustomSearch/CustomInstance.cs @@ -276,11 +276,11 @@ public CustomInstance(CustomSearchAPI client) /// /// A response object containing the response body and response headers. /// - public async Task> SearchWithHttpMessagesAsync(long customConfig, string query, string acceptLanguage = default(string), string userAgent = default(string), string clientId = default(string), string clientIp = default(string), string location = default(string), string countryCode = default(string), int? count = default(int?), string market = "en-us", int? offset = default(int?), string safeSearch = default(string), string setLang = default(string), bool? textDecorations = default(bool?), string textFormat = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> SearchWithHttpMessagesAsync(string customConfig, string query, string acceptLanguage = default(string), string userAgent = default(string), string clientId = default(string), string clientIp = default(string), string location = default(string), string countryCode = default(string), int? count = default(int?), string market = "en-us", int? offset = default(int?), string safeSearch = default(string), string setLang = default(string), bool? textDecorations = default(bool?), string textFormat = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (customConfig < 0) + if (customConfig == null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "customConfig", 0); + throw new ValidationException(ValidationRules.CannotBeNull, "customConfig"); } if (query == null) { diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Generated/CustomSearch/CustomInstanceExtensions.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Generated/CustomSearch/CustomInstanceExtensions.cs index 7933fdd41665..7ebda4cf4668 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Generated/CustomSearch/CustomInstanceExtensions.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Generated/CustomSearch/CustomInstanceExtensions.cs @@ -230,7 +230,7 @@ public static partial class CustomInstanceExtensions /// /// The cancellation token. /// - public static async Task SearchAsync(this ICustomInstance operations, long customConfig, string query, string acceptLanguage = default(string), string userAgent = default(string), string clientId = default(string), string clientIp = default(string), string location = default(string), string countryCode = default(string), int? count = default(int?), string market = "en-us", int? offset = default(int?), string safeSearch = default(string), string setLang = default(string), bool? textDecorations = default(bool?), string textFormat = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task SearchAsync(this ICustomInstance operations, string customConfig, string query, string acceptLanguage = default(string), string userAgent = default(string), string clientId = default(string), string clientIp = default(string), string location = default(string), string countryCode = default(string), int? count = default(int?), string market = "en-us", int? offset = default(int?), string safeSearch = default(string), string setLang = default(string), bool? textDecorations = default(bool?), string textFormat = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.SearchWithHttpMessagesAsync(customConfig, query, acceptLanguage, userAgent, clientId, clientIp, location, countryCode, count, market, offset, safeSearch, setLang, textDecorations, textFormat, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Generated/CustomSearch/ICustomInstance.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Generated/CustomSearch/ICustomInstance.cs index 5be3ad79e05d..6b745553d868 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Generated/CustomSearch/ICustomInstance.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Generated/CustomSearch/ICustomInstance.cs @@ -262,6 +262,6 @@ public partial interface ICustomInstance /// /// Thrown when a required parameter is null /// - Task> SearchWithHttpMessagesAsync(long customConfig, string query, string acceptLanguage = default(string), string userAgent = default(string), string clientId = default(string), string clientIp = default(string), string location = default(string), string countryCode = default(string), int? count = default(int?), string market = "en-us", int? offset = default(int?), string safeSearch = default(string), string setLang = default(string), bool? textDecorations = default(bool?), string textFormat = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> SearchWithHttpMessagesAsync(string customConfig, string query, string acceptLanguage = default(string), string userAgent = default(string), string clientId = default(string), string clientIp = default(string), string location = default(string), string countryCode = default(string), int? count = default(int?), string market = "en-us", int? offset = default(int?), string safeSearch = default(string), string setLang = default(string), bool? textDecorations = default(bool?), string textFormat = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Microsoft.Azure.CognitiveServices.Search.CustomSearch.csproj b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Microsoft.Azure.CognitiveServices.Search.CustomSearch.csproj index ce7ed2b74ccb..db8a9de2c897 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Microsoft.Azure.CognitiveServices.Search.CustomSearch.csproj +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Microsoft.Azure.CognitiveServices.Search.CustomSearch.csproj @@ -6,14 +6,20 @@ Microsoft.Azure.CognitiveServices.Search.CustomSearch This client library provides access to the Microsoft Cognitive Services Custom Search API. - 1.2.0 + 1.3.0 Microsoft.Azure.CognitiveServices.Search.CustomSearch Microsoft Cognitive Services;Cognitive Services;Cognitive Services SDK;CustomSearch API;BingCustomSearch API;REST HTTPclient;CustomSearchSDK;BingCustomSearchSDK;netcore451511 - This is a public release of the Cognitive Services Search SDK. Included with this release is support for Custom Search API. + + net452;netstandard1.4 + + + diff --git a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Properties/AssemblyInfo.cs b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Properties/AssemblyInfo.cs index 062433ae0e89..2ee530569005 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Properties/AssemblyInfo.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Properties/AssemblyInfo.cs @@ -8,7 +8,7 @@ [assembly: AssemblyDescription("Provides API functions for consuming the Microsoft Azure Cognitive Services Custom Search API.")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.2.0.0")] +[assembly: AssemblyFileVersion("1.3.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] diff --git a/src/SDKs/_metadata/cognitiveservices_data-plane_CustomImageSearch.txt b/src/SDKs/_metadata/cognitiveservices_data-plane_CustomImageSearch.txt index 943ec4a7ca7a..b7f68356edf7 100644 --- a/src/SDKs/_metadata/cognitiveservices_data-plane_CustomImageSearch.txt +++ b/src/SDKs/_metadata/cognitiveservices_data-plane_CustomImageSearch.txt @@ -1,11 +1,11 @@ -2018-05-03 09:18:53 UTC +2018-09-13 10:23:28 UTC 1) azure-rest-api-specs repository information GitHub user: Azure Branch: master -Commit: 82502085032e822e2408d3e6f5d6a6e498f01c62 +Commit: 8b107a79bf797084cbbb643b8c65143229bc6783 2) AutoRest information Requested version: latest -Bootstrapper version: C:\Users\ahosma\AppData\Roaming\npm `-- autorest@2.0.4262 +Bootstrapper version: C:\Users\ahosma\AppData\Roaming\npm `-- autorest@2.0.4283 Latest installed version: diff --git a/src/SDKs/_metadata/cognitiveservices_data-plane_CustomSearch.txt b/src/SDKs/_metadata/cognitiveservices_data-plane_CustomSearch.txt index 61fccbdbae90..a1b44895884c 100644 --- a/src/SDKs/_metadata/cognitiveservices_data-plane_CustomSearch.txt +++ b/src/SDKs/_metadata/cognitiveservices_data-plane_CustomSearch.txt @@ -1,11 +1,11 @@ -2018-02-08 09:29:49 UTC +2018-09-13 10:20:32 UTC 1) azure-rest-api-specs repository information GitHub user: Azure Branch: master -Commit: d39e79a6610a5be360b729fcb267aa9d56dafb61 +Commit: 8b107a79bf797084cbbb643b8c65143229bc6783 2) AutoRest information Requested version: latest -Bootstrapper version: C:\Users\a-ahosma\AppData\Roaming\npm `-- autorest@2.0.4245 +Bootstrapper version: C:\Users\ahosma\AppData\Roaming\npm `-- autorest@2.0.4283 Latest installed version: