Skip to content

Commit

Permalink
CodeGen from PR 11712 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 90ef14ad8206b370768344c6a98fb77681e76114 into 22f1bcd60133ac06ec9aaa109758237b7506c9f8
  • Loading branch information
SDKAuto committed Nov 23, 2020
1 parent 87d97a9 commit ab2f3cd
Show file tree
Hide file tree
Showing 12 changed files with 734 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdk/resources/mgmt-v2019_06_01/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-arm-parent</artifactId>
<version>1.2.0</version>
<relativePath>../../parents/azure-arm-parent</relativePath>
<version>1.1.0</version>
<relativePath>../../../pom.management.xml</relativePath>
</parent>
<artifactId>azure-mgmt-resources</artifactId>
<version>1.0.0-beta</version>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* 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.resources.v2019_06_01;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Error description and code explaining why resource name is invalid.
*/
public class ErrorDefinition {
/**
* Description of the error.
*/
@JsonProperty(value = "message")
private String message;

/**
* Code of the error.
*/
@JsonProperty(value = "code")
private String code;

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

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

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

/**
* Set code of the error.
*
* @param code the code value to set
* @return the ErrorDefinition object itself.
*/
public ErrorDefinition withCode(String code) {
this.code = code;
return this;
}

}
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.resources.v2019_06_01;

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.resources.v2019_06_01;

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,69 @@
/**
* 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.resources.v2019_06_01;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Name and Type of the Resource.
*/
public class ResourceName {
/**
* Name of the resource.
*/
@JsonProperty(value = "name", required = true)
private String name;

/**
* The type of the resource.
*/
@JsonProperty(value = "type", required = true)
private String type;

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

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

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

/**
* Set the type of the resource.
*
* @param type the type value to set
* @return the ResourceName object itself.
*/
public ResourceName withType(String type) {
this.type = type;
return this;
}

}
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.management.resources.v2019_06_01;

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

/**
* Defines values for ResourceNameStatus.
*/
public final class ResourceNameStatus extends ExpandableStringEnum<ResourceNameStatus> {
/** Static value Allowed for ResourceNameStatus. */
public static final ResourceNameStatus ALLOWED = fromString("Allowed");

/** Static value Reserved for ResourceNameStatus. */
public static final ResourceNameStatus RESERVED = fromString("Reserved");

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

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

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
* Defines values for TenantCategory.
*/
public enum TenantCategory {
/** Enum value Home. */
HOME("Home"),

/** Enum value ProjectedBy. */
PROJECTED_BY("ProjectedBy"),

/** Enum value ManagedBy. */
MANAGED_BY("ManagedBy");

/** The actual serialized value for a TenantCategory instance. */
private String value;

TenantCategory(String value) {
this.value = value;
}

/**
* Parses a serialized value to a TenantCategory instance.
*
* @param value the serialized value to parse.
* @return the parsed TenantCategory object, or null if unable to parse.
*/
@JsonCreator
public static TenantCategory fromString(String value) {
TenantCategory[] items = TenantCategory.values();
for (TenantCategory item : items) {
if (item.toString().equalsIgnoreCase(value)) {
return item;
}
}
return null;
}

@JsonValue
@Override
public String toString() {
return this.value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,42 @@
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.resources.v2019_06_01.implementation.ResourcesManager;
import com.microsoft.azure.management.resources.v2019_06_01.implementation.TenantIdDescriptionInner;
import java.util.List;

/**
* Type representing TenantIdDescription.
*/
public interface TenantIdDescription extends HasInner<TenantIdDescriptionInner>, HasManager<ResourcesManager> {
/**
* @return the country value.
*/
String country();

/**
* @return the countryCode value.
*/
String countryCode();

/**
* @return the displayName value.
*/
String displayName();

/**
* @return the domains value.
*/
List<String> domains();

/**
* @return the id value.
*/
String id();

/**
* @return the tenantCategory value.
*/
TenantCategory tenantCategory();

/**
* @return the tenantId value.
*/
Expand Down
Loading

0 comments on commit ab2f3cd

Please sign in to comment.