Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* 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.customsearch;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonSubTypes;

/**
* The Answer model.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type")
@JsonTypeName("Answer")
@JsonSubTypes({
@JsonSubTypes.Type(name = "SearchResultsAnswer", value = SearchResultsAnswer.class)
})
public class Answer extends Response {
/**
* The followUpQueries property.
*/
@JsonProperty(value = "followUpQueries", access = JsonProperty.Access.WRITE_ONLY)
private List<Query> followUpQueries;

/**
* Get the followUpQueries value.
*
* @return the followUpQueries value
*/
public List<Query> followUpQueries() {
return this.followUpQueries;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/**
* 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.customsearch;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonSubTypes;

/**
* The CreativeWork model.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type")
@JsonTypeName("CreativeWork")
@JsonSubTypes({
@JsonSubTypes.Type(name = "WebPage", value = WebPage.class)
})
public class CreativeWork extends Thing {
/**
* The URL to a thumbnail of the item.
*/
@JsonProperty(value = "thumbnailUrl", access = JsonProperty.Access.WRITE_ONLY)
private String thumbnailUrl;

/**
* The source of the creative work.
*/
@JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY)
private List<Thing> provider;

/**
* The text property.
*/
@JsonProperty(value = "text", access = JsonProperty.Access.WRITE_ONLY)
private String text;

/**
* Get the thumbnailUrl value.
*
* @return the thumbnailUrl value
*/
public String thumbnailUrl() {
return this.thumbnailUrl;
}

/**
* Get the provider value.
*
* @return the provider value
*/
public List<Thing> provider() {
return this.provider;
}

/**
* Get the text value.
*
* @return the text value
*/
public String text() {
return this.text;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/**
* 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.customsearch;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Defines the error that occurred.
*/
public class Error {
/**
* The error code that identifies the category of error. Possible values
* include: 'None', 'ServerError', 'InvalidRequest', 'RateLimitExceeded',
* 'InvalidAuthorization', 'InsufficientAuthorization'.
*/
@JsonProperty(value = "code", required = true)
private ErrorCode code;

/**
* 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(value = "subCode", access = JsonProperty.Access.WRITE_ONLY)
private ErrorSubCode subCode;

/**
* A description of the error.
*/
@JsonProperty(value = "message", required = true)
private String message;

/**
* A description that provides additional information about the error.
*/
@JsonProperty(value = "moreDetails", access = JsonProperty.Access.WRITE_ONLY)
private String moreDetails;

/**
* The parameter in the request that caused the error.
*/
@JsonProperty(value = "parameter", access = JsonProperty.Access.WRITE_ONLY)
private String parameter;

/**
* The parameter's value in the request that was not valid.
*/
@JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY)
private String value;

/**
* Get the code value.
*
* @return the code value
*/
public ErrorCode code() {
return this.code;
}

/**
* Set the code value.
*
* @param code the code value to set
* @return the Error object itself.
*/
public Error withCode(ErrorCode code) {
this.code = code;
return this;
}

/**
* Get the subCode value.
*
* @return the subCode value
*/
public ErrorSubCode subCode() {
return this.subCode;
}

/**
* Get the message value.
*
* @return the message value
*/
public String message() {
return this.message;
}

/**
* Set the message value.
*
* @param message the message value to set
* @return the Error object itself.
*/
public Error withMessage(String message) {
this.message = message;
return this;
}

/**
* Get the moreDetails value.
*
* @return the moreDetails value
*/
public String moreDetails() {
return this.moreDetails;
}

/**
* Get the parameter value.
*
* @return the parameter value
*/
public String parameter() {
return this.parameter;
}

/**
* Get the value value.
*
* @return the value value
*/
public String value() {
return this.value;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* 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.customsearch;

import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;

/**
* Defines values for ErrorCode.
*/
public final class ErrorCode extends ExpandableStringEnum<ErrorCode> {
/** Static value None for ErrorCode. */
public static final ErrorCode NONE = fromString("None");

/** Static value ServerError for ErrorCode. */
public static final ErrorCode SERVER_ERROR = fromString("ServerError");

/** Static value InvalidRequest for ErrorCode. */
public static final ErrorCode INVALID_REQUEST = fromString("InvalidRequest");

/** Static value RateLimitExceeded for ErrorCode. */
public static final ErrorCode RATE_LIMIT_EXCEEDED = fromString("RateLimitExceeded");

/** Static value InvalidAuthorization for ErrorCode. */
public static final ErrorCode INVALID_AUTHORIZATION = fromString("InvalidAuthorization");

/** Static value InsufficientAuthorization for ErrorCode. */
public static final ErrorCode INSUFFICIENT_AUTHORIZATION = fromString("InsufficientAuthorization");

/**
* Creates or finds a ErrorCode from its string representation.
* @param name a name to look for
* @return the corresponding ErrorCode
*/
@JsonCreator
public static ErrorCode fromString(String name) {
return fromString(name, ErrorCode.class);
}

/**
* @return known ErrorCode values
*/
public static Collection<ErrorCode> values() {
return values(ErrorCode.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* 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.customsearch;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
* The top-level response that represents a failed request.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type")
@JsonTypeName("ErrorResponse")
public class ErrorResponse extends Response {
/**
* A list of errors that describe the reasons why the request failed.
*/
@JsonProperty(value = "errors", required = true)
private List<Error> errors;

/**
* Get the errors value.
*
* @return the errors value
*/
public List<Error> errors() {
return this.errors;
}

/**
* Set the errors value.
*
* @param errors the errors value to set
* @return the ErrorResponse object itself.
*/
public ErrorResponse withErrors(List<Error> errors) {
this.errors = errors;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* 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.customsearch;

import com.microsoft.rest.RestException;
import okhttp3.ResponseBody;
import retrofit2.Response;

/**
* Exception thrown for an invalid response with ErrorResponse information.
*/
public class ErrorResponseException extends RestException {
/**
* Initializes a new instance of the ErrorResponseException class.
*
* @param message the exception message or the response content if a message is not available
* @param response the HTTP response
*/
public ErrorResponseException(final String message, final Response<ResponseBody> response) {
super(message, response);
}

/**
* Initializes a new instance of the ErrorResponseException class.
*
* @param message the exception message or the response content if a message is not available
* @param response the HTTP response
* @param body the deserialized response body
*/
public ErrorResponseException(final String message, final Response<ResponseBody> response, final ErrorResponse body) {
super(message, response, body);
}

@Override
public ErrorResponse body() {
return (ErrorResponse) super.body();
}
}
Loading