Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Generated from b1485a40b89166473e0bfe61a469f9e7d0aace12
Updating swagger title for custom image search to Custom Image Search Client
  • Loading branch information
AutorestCI committed Sep 5, 2018
commit 9b3819eaf6a678b3bf6d5a3101e1ca102c468aba
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.cognitiveservices.search.customimagesearch;

import com.microsoft.azure.AzureClient;
import com.microsoft.rest.RestClient;

/**
* The interface for CustomImageSearchClient class.
*/
public interface CustomImageSearchClient {
/**
* Gets the REST client.
*
* @return the {@link RestClient} object.
*/
RestClient restClient();

/**
* Gets the {@link AzureClient} used for long running operations.
* @return the azure client;
*/
AzureClient getAzureClient();

/**
* Gets the User-Agent header for the client.
*
* @return the user agent string.
*/
String userAgent();

/**
* Gets Gets or sets the preferred language for the response..
*
* @return the acceptLanguage value.
*/
String acceptLanguage();

/**
* Sets Gets or sets the preferred language for the response..
*
* @param acceptLanguage the acceptLanguage value.
* @return the service client itself
*/
CustomImageSearchClient withAcceptLanguage(String acceptLanguage);

/**
* Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30..
*
* @return the longRunningOperationRetryTimeout value.
*/
int longRunningOperationRetryTimeout();

/**
* Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30..
*
* @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value.
* @return the service client itself
*/
CustomImageSearchClient withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout);

/**
* Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true..
*
* @return the generateClientRequestId value.
*/
boolean generateClientRequestId();

/**
* Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true..
*
* @param generateClientRequestId the generateClientRequestId value.
* @return the service client itself
*/
CustomImageSearchClient withGenerateClientRequestId(boolean generateClientRequestId);

/**
* Gets the CustomInstances object to access its operations.
* @return the CustomInstances object.
*/
CustomInstances customInstances();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.cognitiveservices.search.customimagesearch.implementation;

import com.microsoft.azure.AzureClient;
import com.microsoft.azure.AzureServiceClient;
import com.microsoft.azure.cognitiveservices.search.customimagesearch.CustomImageSearchClient;
import com.microsoft.azure.cognitiveservices.search.customimagesearch.CustomInstances;
import com.microsoft.rest.credentials.ServiceClientCredentials;
import com.microsoft.rest.RestClient;

/**
* Initializes a new instance of the CustomImageSearchClientImpl class.
*/
public class CustomImageSearchClientImpl extends AzureServiceClient implements CustomImageSearchClient {
/** the {@link AzureClient} used for long running operations. */
private AzureClient azureClient;

/**
* Gets the {@link AzureClient} used for long running operations.
* @return the azure client;
*/
public AzureClient getAzureClient() {
return this.azureClient;
}

/** Gets or sets the preferred language for the response. */
private String acceptLanguage;

/**
* Gets Gets or sets the preferred language for the response.
*
* @return the acceptLanguage value.
*/
public String acceptLanguage() {
return this.acceptLanguage;
}

/**
* Sets Gets or sets the preferred language for the response.
*
* @param acceptLanguage the acceptLanguage value.
* @return the service client itself
*/
public CustomImageSearchClientImpl withAcceptLanguage(String acceptLanguage) {
this.acceptLanguage = acceptLanguage;
return this;
}

/** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */
private int longRunningOperationRetryTimeout;

/**
* Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
*
* @return the longRunningOperationRetryTimeout value.
*/
public int longRunningOperationRetryTimeout() {
return this.longRunningOperationRetryTimeout;
}

/**
* Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
*
* @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value.
* @return the service client itself
*/
public CustomImageSearchClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) {
this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout;
return this;
}

/** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */
private boolean generateClientRequestId;

/**
* Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
*
* @return the generateClientRequestId value.
*/
public boolean generateClientRequestId() {
return this.generateClientRequestId;
}

/**
* Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
*
* @param generateClientRequestId the generateClientRequestId value.
* @return the service client itself
*/
public CustomImageSearchClientImpl withGenerateClientRequestId(boolean generateClientRequestId) {
this.generateClientRequestId = generateClientRequestId;
return this;
}

/**
* The CustomInstances object to access its operations.
*/
private CustomInstances customInstances;

/**
* Gets the CustomInstances object to access its operations.
* @return the CustomInstances object.
*/
public CustomInstances customInstances() {
return this.customInstances;
}

/**
* Initializes an instance of CustomImageSearchClient client.
*
* @param credentials the management credentials for Azure
*/
public CustomImageSearchClientImpl(ServiceClientCredentials credentials) {
this("https://api.cognitive.microsoft.com/bingcustomsearch/v7.0", credentials);
}

/**
* Initializes an instance of CustomImageSearchClient client.
*
* @param baseUrl the base URL of the host
* @param credentials the management credentials for Azure
*/
public CustomImageSearchClientImpl(String baseUrl, ServiceClientCredentials credentials) {
super(baseUrl, credentials);
initialize();
}

/**
* Initializes an instance of CustomImageSearchClient client.
*
* @param restClient the REST client to connect to Azure.
*/
public CustomImageSearchClientImpl(RestClient restClient) {
super(restClient);
initialize();
}

protected void initialize() {
this.acceptLanguage = "en-US";
this.longRunningOperationRetryTimeout = 30;
this.generateClientRequestId = true;
this.customInstances = new CustomInstancesImpl(restClient().retrofit(), this);
this.azureClient = new AzureClient(this);
}

/**
* Gets the User-Agent header for the client.
*
* @return the user agent string.
*/
@Override
public String userAgent() {
return String.format("%s (%s, %s)", super.userAgent(), "CustomImageSearchClient", "1.0");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ public class CustomInstancesImpl implements CustomInstances {
/** The Retrofit service to perform REST calls. */
private CustomInstancesService service;
/** The service client containing this operation class. */
private CustomImageSearchAPIImpl client;
private CustomImageSearchClientImpl client;

/**
* Initializes an instance of CustomInstancesImpl.
*
* @param retrofit the Retrofit instance built from a Retrofit Builder.
* @param client the instance of the service client containing this operation class.
*/
public CustomInstancesImpl(Retrofit retrofit, CustomImageSearchAPIImpl client) {
public CustomInstancesImpl(Retrofit retrofit, CustomImageSearchClientImpl client) {
this.service = retrofit.create(CustomInstancesService.class);
this.client = client;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Code generated by Microsoft (R) AutoRest Code Generator.

/**
* This package contains the implementation classes for CustomImageSearchAPI.
* This package contains the implementation classes for CustomImageSearchClient.
* The Bing Custom Image Search API lets you send an image search query to Bing and get back image search results customized to meet your custom search definition.
*/
package com.microsoft.azure.cognitiveservices.search.customimagesearch.implementation;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Code generated by Microsoft (R) AutoRest Code Generator.

/**
* This package contains the models classes for CustomImageSearchAPI.
* This package contains the models classes for CustomImageSearchClient.
* The Bing Custom Image Search API lets you send an image search query to Bing and get back image search results customized to meet your custom search definition.
*/
package com.microsoft.azure.cognitiveservices.search.customimagesearch.models;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Code generated by Microsoft (R) AutoRest Code Generator.

/**
* This package contains the classes for CustomImageSearchAPI.
* This package contains the classes for CustomImageSearchClient.
* The Bing Custom Image Search API lets you send an image search query to Bing and get back image search results customized to meet your custom search definition.
*/
package com.microsoft.azure.cognitiveservices.search.customimagesearch;