2 * Copyright (c) 2010-2023 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.homeconnect.internal.client.model;
15 import static org.openhab.binding.homeconnect.internal.HomeConnectBindingConstants.API_BASE_URL;
16 import static org.openhab.binding.homeconnect.internal.HomeConnectBindingConstants.API_SIMULATOR_BASE_URL;
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.eclipse.jdt.annotation.Nullable;
27 * @author Jonas BrĂ¼stel - Initial Contribution
30 public class HomeConnectRequest {
31 private final String url;
32 private final String method;
33 private final Map<String, String> header;
34 private @Nullable final String body;
36 public HomeConnectRequest(String url, String method, Map<String, String> header, @Nullable String body) {
43 public String getUrl() {
47 public String getShortUrl() {
48 return url.replace(API_BASE_URL, "").replace(API_SIMULATOR_BASE_URL, "");
51 public String getMethod() {
55 public Map<String, String> getHeader() {
59 public @Nullable String getBody() {
64 public String toString() {
65 return "Request [url=" + url + ", method=" + method + ", header=" + header + ", body=" + body + "]";