]> git.basschouten.com Git - openhab-addons.git/blob
dadba41e0a423e25caef0b712912295cf99a58da
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.sensibo.internal.dto.setacstateproperty;
14
15 import org.openhab.binding.sensibo.internal.dto.AbstractRequest;
16
17 /**
18  * All classes in the ..binding.sensibo.dto are data transfer classes used by the GSON mapper. This class reflects a
19  * part of a request/response data structure.
20  *
21  * @author Arne Seime - Initial contribution.
22  */
23 public class SetAcStatePropertyRequest extends AbstractRequest {
24     public transient String podId; // Transient fields are ignored by gson
25     public transient String property;
26     public Object newValue;
27
28     public SetAcStatePropertyRequest(String podId, String property, Object value) {
29         this.podId = podId;
30         this.property = property;
31         this.newValue = value;
32     }
33
34     @Override
35     public String getRequestUrl() {
36         return String.format("/v2/pods/%s/acStates/%s", podId, property);
37     }
38
39     @Override
40     public String getMethod() {
41         return "PATCH";
42     }
43 }