All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliyuncs.ddoscoo.transform.v20200101.DescribeWebRulesResponseUnmarshaller Maven / Gradle / Ivy

/*
 * 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.ddoscoo.transform.v20200101;

import java.util.ArrayList;
import java.util.List;

import com.aliyuncs.ddoscoo.model.v20200101.DescribeWebRulesResponse;
import com.aliyuncs.ddoscoo.model.v20200101.DescribeWebRulesResponse.WebRule;
import com.aliyuncs.ddoscoo.model.v20200101.DescribeWebRulesResponse.WebRule.GmCert;
import com.aliyuncs.ddoscoo.model.v20200101.DescribeWebRulesResponse.WebRule.ProxyConfig;
import com.aliyuncs.ddoscoo.model.v20200101.DescribeWebRulesResponse.WebRule.RealServer;
import com.aliyuncs.transform.UnmarshallerContext;


public class DescribeWebRulesResponseUnmarshaller {

	public static DescribeWebRulesResponse unmarshall(DescribeWebRulesResponse describeWebRulesResponse, UnmarshallerContext _ctx) {
		
		describeWebRulesResponse.setRequestId(_ctx.stringValue("DescribeWebRulesResponse.RequestId"));
		describeWebRulesResponse.setTotalCount(_ctx.longValue("DescribeWebRulesResponse.TotalCount"));

		List webRules = new ArrayList();
		for (int i = 0; i < _ctx.lengthValue("DescribeWebRulesResponse.WebRules.Length"); i++) {
			WebRule webRule = new WebRule();
			webRule.setDomain(_ctx.stringValue("DescribeWebRulesResponse.WebRules["+ i +"].Domain"));
			webRule.setHttp2HttpsEnable(_ctx.booleanValue("DescribeWebRulesResponse.WebRules["+ i +"].Http2HttpsEnable"));
			webRule.setSslProtocols(_ctx.stringValue("DescribeWebRulesResponse.WebRules["+ i +"].SslProtocols"));
			webRule.setPunishReason(_ctx.integerValue("DescribeWebRulesResponse.WebRules["+ i +"].PunishReason"));
			webRule.setCcTemplate(_ctx.stringValue("DescribeWebRulesResponse.WebRules["+ i +"].CcTemplate"));
			webRule.setCcEnabled(_ctx.booleanValue("DescribeWebRulesResponse.WebRules["+ i +"].CcEnabled"));
			webRule.setSslCiphers(_ctx.stringValue("DescribeWebRulesResponse.WebRules["+ i +"].SslCiphers"));
			webRule.setSsl13Enabled(_ctx.booleanValue("DescribeWebRulesResponse.WebRules["+ i +"].Ssl13Enabled"));
			webRule.setCcRuleEnabled(_ctx.booleanValue("DescribeWebRulesResponse.WebRules["+ i +"].CcRuleEnabled"));
			webRule.setOcspEnabled(_ctx.booleanValue("DescribeWebRulesResponse.WebRules["+ i +"].OcspEnabled"));
			webRule.setPunishStatus(_ctx.booleanValue("DescribeWebRulesResponse.WebRules["+ i +"].PunishStatus"));
			webRule.setProxyEnabled(_ctx.booleanValue("DescribeWebRulesResponse.WebRules["+ i +"].ProxyEnabled"));
			webRule.setCertName(_ctx.stringValue("DescribeWebRulesResponse.WebRules["+ i +"].CertName"));
			webRule.setPolicyMode(_ctx.stringValue("DescribeWebRulesResponse.WebRules["+ i +"].PolicyMode"));
			webRule.setCname(_ctx.stringValue("DescribeWebRulesResponse.WebRules["+ i +"].Cname"));
			webRule.setHttp2Enable(_ctx.booleanValue("DescribeWebRulesResponse.WebRules["+ i +"].Http2Enable"));
			webRule.setHttps2HttpEnable(_ctx.booleanValue("DescribeWebRulesResponse.WebRules["+ i +"].Https2HttpEnable"));
			webRule.setCertRegion(_ctx.stringValue("DescribeWebRulesResponse.WebRules["+ i +"].CertRegion"));

			List whiteList = new ArrayList();
			for (int j = 0; j < _ctx.lengthValue("DescribeWebRulesResponse.WebRules["+ i +"].WhiteList.Length"); j++) {
				whiteList.add(_ctx.stringValue("DescribeWebRulesResponse.WebRules["+ i +"].WhiteList["+ j +"]"));
			}
			webRule.setWhiteList(whiteList);

			List blackList = new ArrayList();
			for (int j = 0; j < _ctx.lengthValue("DescribeWebRulesResponse.WebRules["+ i +"].BlackList.Length"); j++) {
				blackList.add(_ctx.stringValue("DescribeWebRulesResponse.WebRules["+ i +"].BlackList["+ j +"]"));
			}
			webRule.setBlackList(blackList);

			List customCiphers = new ArrayList();
			for (int j = 0; j < _ctx.lengthValue("DescribeWebRulesResponse.WebRules["+ i +"].CustomCiphers.Length"); j++) {
				customCiphers.add(_ctx.stringValue("DescribeWebRulesResponse.WebRules["+ i +"].CustomCiphers["+ j +"]"));
			}
			webRule.setCustomCiphers(customCiphers);

			GmCert gmCert = new GmCert();
			gmCert.setCertId(_ctx.stringValue("DescribeWebRulesResponse.WebRules["+ i +"].GmCert.CertId"));
			gmCert.setGmEnable(_ctx.longValue("DescribeWebRulesResponse.WebRules["+ i +"].GmCert.GmEnable"));
			gmCert.setGmOnly(_ctx.longValue("DescribeWebRulesResponse.WebRules["+ i +"].GmCert.GmOnly"));
			webRule.setGmCert(gmCert);

			List proxyTypes = new ArrayList();
			for (int j = 0; j < _ctx.lengthValue("DescribeWebRulesResponse.WebRules["+ i +"].ProxyTypes.Length"); j++) {
				ProxyConfig proxyConfig = new ProxyConfig();
				proxyConfig.setProxyType(_ctx.stringValue("DescribeWebRulesResponse.WebRules["+ i +"].ProxyTypes["+ j +"].ProxyType"));

				List proxyPorts = new ArrayList();
				for (int k = 0; k < _ctx.lengthValue("DescribeWebRulesResponse.WebRules["+ i +"].ProxyTypes["+ j +"].ProxyPorts.Length"); k++) {
					proxyPorts.add(_ctx.stringValue("DescribeWebRulesResponse.WebRules["+ i +"].ProxyTypes["+ j +"].ProxyPorts["+ k +"]"));
				}
				proxyConfig.setProxyPorts(proxyPorts);

				proxyTypes.add(proxyConfig);
			}
			webRule.setProxyTypes(proxyTypes);

			List realServers = new ArrayList();
			for (int j = 0; j < _ctx.lengthValue("DescribeWebRulesResponse.WebRules["+ i +"].RealServers.Length"); j++) {
				RealServer realServer = new RealServer();
				realServer.setRsType(_ctx.integerValue("DescribeWebRulesResponse.WebRules["+ i +"].RealServers["+ j +"].RsType"));
				realServer.setRealServer(_ctx.stringValue("DescribeWebRulesResponse.WebRules["+ i +"].RealServers["+ j +"].RealServer"));

				realServers.add(realServer);
			}
			webRule.setRealServers(realServers);

			webRules.add(webRule);
		}
		describeWebRulesResponse.setWebRules(webRules);
	 
	 	return describeWebRulesResponse;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy