// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.api.response;

import com.google.gson.annotations.SerializedName;

import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;

import com.cloud.serializer.Param;

@SuppressWarnings("unused")
public class ResourceTagResponse extends BaseResponse implements ControlledViewEntityResponse {
    @SerializedName(ApiConstants.KEY)
    @Param(description = "tag key name")
    private String key;

    @SerializedName(ApiConstants.VALUE)
    @Param(description = "tag value")
    private String value;

    @SerializedName(ApiConstants.RESOURCE_TYPE)
    @Param(description = "resource type")
    private String resourceType;

    @SerializedName(ApiConstants.RESOURCE_ID)
    @Param(description = "id of the resource")
    private String resourceId;

    @SerializedName(ApiConstants.ACCOUNT)
    @Param(description = "the account associated with the tag")
    private String accountName;

    @SerializedName(ApiConstants.PROJECT_ID)
    @Param(description = "the project id the tag belongs to")
    private String projectId;

    @SerializedName(ApiConstants.PROJECT)
    @Param(description = "the project name where tag belongs to")
    private String projectName;

    @SerializedName(ApiConstants.DOMAIN_ID)
    @Param(description = "the ID of the domain associated with the tag")
    private String domainId;

    @SerializedName(ApiConstants.DOMAIN)
    @Param(description = "the domain associated with the tag")
    private String domainName;

    @SerializedName(ApiConstants.CUSTOMER)
    @Param(description = "customer associated with the tag")
    private String customer;

    public void setKey(String key) {
        this.key = key;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public void setResourceType(String resourceType) {
        this.resourceType = resourceType;
    }

    public void setResourceId(String id) {
        this.resourceId = id;
    }

    @Override
    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    @Override
    public void setDomainId(String domainId) {
        this.domainId = domainId;
    }

    @Override
    public void setDomainName(String domainName) {
        this.domainName = domainName;
    }

    @Override
    public void setProjectId(String projectId) {
        this.projectId = projectId;
    }

    @Override
    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public void setCustomer(String customer) {
        this.customer = customer;
    }

    public String getResourceId() {
        return this.resourceId;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        String rId = this.getResourceId();
        result = prime * result + ((rId== null) ? 0 : rId.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (this.getClass() != obj.getClass())
            return false;
        ResourceTagResponse other = (ResourceTagResponse) obj;
        String rId = this.getResourceId();
        if (rId == null && other.getResourceId() != null) {
            return false;
        } else if (!rId.equals(other.getResourceId()))
            return false;
        return true;
    }
}

@@ -3422,26 +3422,19 @@
 ring get
-ResourceId
+Key
 () %7B%0A   
@@ -3450,26 +3450,19 @@
 rn this.
-resourceId
+key
 ;%0A    %7D%0A
@@ -3565,35 +3565,35 @@
 %0A        String 
-rId
+key
  = this.getResou
@@ -3583,34 +3583,27 @@
 y = this.get
-ResourceId
+Key
 ();%0A        
@@ -3630,19 +3630,20 @@
 ult + ((
-rId
+key 
 == null)
@@ -3649,19 +3649,19 @@
 ) ? 0 : 
-rId
+key
 .hashCod
@@ -3863,21 +3863,16 @@
     if (
-this.
 getClass
@@ -3997,19 +3997,19 @@
  String 
-rId
+key
  = this.
@@ -4011,26 +4011,19 @@
 this.get
-ResourceId
+Key
 ();%0A    
@@ -4034,19 +4034,19 @@
 if (
-rId
+key
  == null
  && 
@@ -4045,31 +4045,40 @@
 null
- && other.getResourceId
+) %7B%0A            if (other.getKey
 () !
@@ -4080,27 +4080,27 @@
 y() != null)
- %7B%0A
+%0A  
             
@@ -4091,32 +4091,34 @@
 )%0A              
+  
 return false;%0A  
@@ -4139,11 +4139,11 @@
 f (!
-rId
+key
 .equ
@@ -4155,26 +4155,19 @@
 ther.get
-ResourceId
+Key
 ()))%0A   

Use resource tag's key to determine match in equals() method for ResourceTagResponse