From 97b717469128891bcd320f033629720a47a91f09 Mon Sep 17 00:00:00 2001 From: Jianghao Lu Date: Thu, 10 Mar 2016 18:06:48 -0800 Subject: [PATCH] Unify resources in runtime --- .../com/microsoft/azure/BaseResource.java | 14 --- .../java/com/microsoft/azure/Resource.java | 109 ++++++++++++++++++ .../java/com/microsoft/azure/SubResource.java | 36 ++++++ 3 files changed, 145 insertions(+), 14 deletions(-) delete mode 100644 azure-client-runtime/src/main/java/com/microsoft/azure/BaseResource.java create mode 100644 azure-client-runtime/src/main/java/com/microsoft/azure/Resource.java create mode 100644 azure-client-runtime/src/main/java/com/microsoft/azure/SubResource.java diff --git a/azure-client-runtime/src/main/java/com/microsoft/azure/BaseResource.java b/azure-client-runtime/src/main/java/com/microsoft/azure/BaseResource.java deleted file mode 100644 index 16ef8f472a263..0000000000000 --- a/azure-client-runtime/src/main/java/com/microsoft/azure/BaseResource.java +++ /dev/null @@ -1,14 +0,0 @@ -/** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - */ - -package com.microsoft.azure; - -/** - * Defines Azure resource. - */ -public abstract class BaseResource { -} diff --git a/azure-client-runtime/src/main/java/com/microsoft/azure/Resource.java b/azure-client-runtime/src/main/java/com/microsoft/azure/Resource.java new file mode 100644 index 0000000000000..732035538ef6e --- /dev/null +++ b/azure-client-runtime/src/main/java/com/microsoft/azure/Resource.java @@ -0,0 +1,109 @@ +/** + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + */ + +package com.microsoft.azure; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.Map; + +/** + * The Resource model. + */ +public class Resource { + /** + * Resource Id. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Resource name. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Resource type. + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Resource location. + */ + @JsonProperty(required = true) + private String location; + + /** + * Resource tags. + */ + private Map tags; + + /** + * Get the id value. + * + * @return the id value + */ + public String getId() { + return this.id; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String getName() { + return this.name; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String getType() { + return this.type; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String getLocation() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + */ + public void setLocation(String location) { + this.location = location; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map getTags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + */ + public void setTags(Map tags) { + this.tags = tags; + } +} \ No newline at end of file diff --git a/azure-client-runtime/src/main/java/com/microsoft/azure/SubResource.java b/azure-client-runtime/src/main/java/com/microsoft/azure/SubResource.java new file mode 100644 index 0000000000000..36ca18ae3665b --- /dev/null +++ b/azure-client-runtime/src/main/java/com/microsoft/azure/SubResource.java @@ -0,0 +1,36 @@ +/** + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + */ + +package com.microsoft.azure; + +/** + * The SubResource model. + */ +public class SubResource { + /** + * Resource Id. + */ + private String id; + + /** + * Get the id value. + * + * @return the id value + */ + public String getId() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + */ + public void setId(String id) { + this.id = id; + } +} \ No newline at end of file