Separate logic of get root path
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / nb / rfc8040 / databind / DataPostBody.java
1 /*
2  * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.restconf.nb.rfc8040.databind;
9
10 import java.io.InputStream;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12 import org.opendaylight.restconf.server.api.DataPostPath;
13
14 /**
15  * Body of a {@code POST} request as defined in
16  * <a href="https://www.rfc-editor.org/rfc/rfc8040#section-4.4">RFC8040 section 4.4</a>.
17  * @see DataPostPath
18  */
19 @NonNullByDefault
20 public abstract sealed class DataPostBody extends AbstractBody permits JsonDataPostBody, XmlDataPostBody {
21     DataPostBody(final InputStream inputStream) {
22         super(inputStream);
23     }
24
25     public abstract OperationInputBody toOperationInput();
26
27     public abstract ChildBody toResource();
28 }