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

com.aliyuncs.ddoscoo.transform.v20200101.DescribeDDosAllEventListResponseUnmarshaller 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.DescribeDDosAllEventListResponse;
import com.aliyuncs.ddoscoo.model.v20200101.DescribeDDosAllEventListResponse.AttackEvent;
import com.aliyuncs.transform.UnmarshallerContext;


public class DescribeDDosAllEventListResponseUnmarshaller {

	public static DescribeDDosAllEventListResponse unmarshall(DescribeDDosAllEventListResponse describeDDosAllEventListResponse, UnmarshallerContext _ctx) {
		
		describeDDosAllEventListResponse.setRequestId(_ctx.stringValue("DescribeDDosAllEventListResponse.RequestId"));
		describeDDosAllEventListResponse.setTotal(_ctx.longValue("DescribeDDosAllEventListResponse.Total"));

		List attackEvents = new ArrayList();
		for (int i = 0; i < _ctx.lengthValue("DescribeDDosAllEventListResponse.AttackEvents.Length"); i++) {
			AttackEvent attackEvent = new AttackEvent();
			attackEvent.setEndTime(_ctx.longValue("DescribeDDosAllEventListResponse.AttackEvents["+ i +"].EndTime"));
			attackEvent.setStartTime(_ctx.longValue("DescribeDDosAllEventListResponse.AttackEvents["+ i +"].StartTime"));
			attackEvent.setEventType(_ctx.stringValue("DescribeDDosAllEventListResponse.AttackEvents["+ i +"].EventType"));
			attackEvent.setRegion(_ctx.stringValue("DescribeDDosAllEventListResponse.AttackEvents["+ i +"].Region"));
			attackEvent.setMbps(_ctx.longValue("DescribeDDosAllEventListResponse.AttackEvents["+ i +"].Mbps"));
			attackEvent.setIp(_ctx.stringValue("DescribeDDosAllEventListResponse.AttackEvents["+ i +"].Ip"));
			attackEvent.setArea(_ctx.stringValue("DescribeDDosAllEventListResponse.AttackEvents["+ i +"].Area"));
			attackEvent.setPort(_ctx.stringValue("DescribeDDosAllEventListResponse.AttackEvents["+ i +"].Port"));
			attackEvent.setPps(_ctx.longValue("DescribeDDosAllEventListResponse.AttackEvents["+ i +"].Pps"));

			attackEvents.add(attackEvent);
		}
		describeDDosAllEventListResponse.setAttackEvents(attackEvents);
	 
	 	return describeDDosAllEventListResponse;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy