Skip to content
Merged
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,94 @@
/**
* 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.management.policyinsights;

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

/**
* Error definition.
*/
public class ErrorDefinition {
/**
* Service specific error code which serves as the substatus for the HTTP
* error code.
*/
@JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY)
private String code;

/**
* Description of the error.
*/
@JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY)
private String message;

/**
* The target of the error.
*/
@JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY)
private String target;

/**
* Internal error details.
*/
@JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY)
private List<ErrorDefinition> details;

/**
* Additional scenario specific error details.
*/
@JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY)
private List<TypedErrorInfo> additionalInfo;

/**
* Get service specific error code which serves as the substatus for the HTTP error code.
*
* @return the code value
*/
public String code() {
return this.code;
}

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

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

/**
* Get internal error details.
*
* @return the details value
*/
public List<ErrorDefinition> details() {
return this.details;
}

/**
* Get additional scenario specific error details.
*
* @return the additionalInfo value
*/
public List<TypedErrorInfo> additionalInfo() {
return this.additionalInfo;
}

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

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Error response.
*/
public class ErrorResponse {
/**
* The error details.
*/
@JsonProperty(value = "error")
private ErrorDefinition error;

/**
* Get the error details.
*
* @return the error value
*/
public ErrorDefinition error() {
return this.error;
}

/**
* Set the error details.
*
* @param error the error value to set
* @return the ErrorResponse object itself.
*/
public ErrorResponse withError(ErrorDefinition error) {
this.error = error;
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.management.policyinsights;

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();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/**
* 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.management.policyinsights;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Display metadata associated with the operation.
*/
public class OperationDisplay {
/**
* Resource provider name.
*/
@JsonProperty(value = "provider")
private String provider;

/**
* Resource name on which the operation is performed.
*/
@JsonProperty(value = "resource")
private String resource;

/**
* Operation name.
*/
@JsonProperty(value = "operation")
private String operation;

/**
* Operation description.
*/
@JsonProperty(value = "description")
private String description;

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

/**
* Set resource provider name.
*
* @param provider the provider value to set
* @return the OperationDisplay object itself.
*/
public OperationDisplay withProvider(String provider) {
this.provider = provider;
return this;
}

/**
* Get resource name on which the operation is performed.
*
* @return the resource value
*/
public String resource() {
return this.resource;
}

/**
* Set resource name on which the operation is performed.
*
* @param resource the resource value to set
* @return the OperationDisplay object itself.
*/
public OperationDisplay withResource(String resource) {
this.resource = resource;
return this;
}

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

/**
* Set operation name.
*
* @param operation the operation value to set
* @return the OperationDisplay object itself.
*/
public OperationDisplay withOperation(String operation) {
this.operation = operation;
return this;
}

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

/**
* Set operation description.
*
* @param description the description value to set
* @return the OperationDisplay object itself.
*/
public OperationDisplay withDescription(String description) {
this.description = description;
return this;
}

}
Loading