/*
 * Licensed 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 com.aliyuncs.iot.model.v20180120;

import com.aliyuncs.RpcAcsRequest;
import java.util.List;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.iot.Endpoint;

/**
 * @author auto create
 * @version 
 */
public class UpdateProductTagsRequest extends RpcAcsRequest<UpdateProductTagsResponse> {
	   

	private String iotInstanceId;

	private String productKey;

	private List<ProductTag> productTags;
	public UpdateProductTagsRequest() {
		super("Iot", "2018-01-20", "UpdateProductTags");
		setMethod(MethodType.POST);
		try {
			com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap);
			com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType);
		} catch (Exception e) {}
	}

	public String getIotInstanceId() {
		return this.iotInstanceId;
	}

	public void setIotInstanceId(String iotInstanceId) {
		this.iotInstanceId = iotInstanceId;
		if(iotInstanceId != null){
			putQueryParameter("IotInstanceId", iotInstanceId);
		}
	}

	public String getProductKey() {
		return this.productKey;
	}

	public void setProductKey(String productKey) {
		this.productKey = productKey;
		if(productKey != null){
			putQueryParameter("ProductKey", productKey);
		}
	}

	public List<ProductTag> getProductTags() {
		return this.productTags;
	}

	public void setProductTags(List<ProductTag> productTags) {
		this.productTags = productTags;	
		if (productTags != null) {
			for (int depth1 = 0; depth1 < productTags.size(); depth1++) {
				putQueryParameter("ProductTag." + (depth1 + 1) + ".TagValue" , productTags.get(depth1).getTagValue());
				putQueryParameter("ProductTag." + (depth1 + 1) + ".TagKey" , productTags.get(depth1).getTagKey());
			}
		}	
	}

	public static class ProductTag {

		private String tagValue;

		private String tagKey;

		public String getTagValue() {
			return this.tagValue;
		}

		public void setTagValue(String tagValue) {
			this.tagValue = tagValue;
		}

		public String getTagKey() {
			return this.tagKey;
		}

		public void setTagKey(String tagKey) {
			this.tagKey = tagKey;
		}
	}

	@Override
	public Class<UpdateProductTagsResponse> getResponseClass() {
		return UpdateProductTagsResponse.class;
	}

}
