/*
 * 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.swas_open.model.v20200601;

import com.aliyuncs.RpcAcsRequest;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import com.aliyuncs.http.MethodType;

/**
 * @author auto create
 * @version 
 */
public class CreateFirewallRulesRequest extends RpcAcsRequest<CreateFirewallRulesResponse> {
	   

	private String clientToken;

	private String instanceId;

	@SerializedName("firewallRules")
	private List<FirewallRules> firewallRules;
	public CreateFirewallRulesRequest() {
		super("SWAS-OPEN", "2020-06-01", "CreateFirewallRules", "SWAS-OPEN");
		setMethod(MethodType.POST);
	}

	public String getClientToken() {
		return this.clientToken;
	}

	public void setClientToken(String clientToken) {
		this.clientToken = clientToken;
		if(clientToken != null){
			putQueryParameter("ClientToken", clientToken);
		}
	}

	public String getInstanceId() {
		return this.instanceId;
	}

	public void setInstanceId(String instanceId) {
		this.instanceId = instanceId;
		if(instanceId != null){
			putQueryParameter("InstanceId", instanceId);
		}
	}

	public List<FirewallRules> getFirewallRules() {
		return this.firewallRules;
	}

	public void setFirewallRules(List<FirewallRules> firewallRules) {
		this.firewallRules = firewallRules;	
		if (firewallRules != null) {
			putQueryParameter("FirewallRules" , new Gson().toJson(firewallRules));
		}	
	}

	public static class FirewallRules {

		@SerializedName("RuleProtocol")
		private String ruleProtocol;

		@SerializedName("Port")
		private String port;

		@SerializedName("SourceCidrIp")
		private String sourceCidrIp;

		@SerializedName("Remark")
		private String remark;

		public String getRuleProtocol() {
			return this.ruleProtocol;
		}

		public void setRuleProtocol(String ruleProtocol) {
			this.ruleProtocol = ruleProtocol;
		}

		public String getPort() {
			return this.port;
		}

		public void setPort(String port) {
			this.port = port;
		}

		public String getSourceCidrIp() {
			return this.sourceCidrIp;
		}

		public void setSourceCidrIp(String sourceCidrIp) {
			this.sourceCidrIp = sourceCidrIp;
		}

		public String getRemark() {
			return this.remark;
		}

		public void setRemark(String remark) {
			this.remark = remark;
		}
	}

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

}
