2 * Copyright (c) 2010-2024 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.ecovacs.internal.api.impl.dto.response.portal;
15 import java.util.List;
17 import org.openhab.binding.ecovacs.internal.api.model.CleanMode;
19 import com.google.gson.annotations.SerializedName;
22 * @author Johannes Ptaszyk - Initial contribution
24 public class PortalCleanLogsResponse {
25 public static class LogRecord {
27 public final long timestamp;
29 @SerializedName("last")
30 public final long duration;
32 public final int area;
34 public final String id;
36 public final String imageUrl;
38 public final CleanMode type;
40 // more possible fields: aiavoid (int), aitypes (list of something), stopReason (int)
42 LogRecord(long timestamp, long duration, int area, String id, String imageUrl, CleanMode type) {
43 this.timestamp = timestamp;
44 this.duration = duration;
47 this.imageUrl = imageUrl;
52 @SerializedName("logs")
53 public final List<LogRecord> records;
55 @SerializedName("ret")
58 PortalCleanLogsResponse(String result, List<LogRecord> records) {
60 this.records = records;
63 public boolean wasSuccessful() {
64 return "ok".equals(result);