<reponame>StevenCode/ovirt-engine
/*
 * Copyright oVirt Authors
 * SPDX-License-Identifier: Apache-2.0
*/

package org.ovirt.engine.api.v3.adapters;

import static org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn;

import org.ovirt.engine.api.model.OpenStackSubnets;
import org.ovirt.engine.api.v3.V3Adapter;
import org.ovirt.engine.api.v3.types.V3OpenStackSubnets;

public class V3OpenStackSubnetsInAdapter implements V3Adapter<V3OpenStackSubnets, OpenStackSubnets> {
    @Override
    public OpenStackSubnets adapt(V3OpenStackSubnets from) {
        OpenStackSubnets to = new OpenStackSubnets();
        if (from.isSetActions()) {
            to.setActions(adaptIn(from.getActions()));
        }
        if (from.isSetActive()) {
            to.setActive(from.getActive());
        }
        if (from.isSetSize()) {
            to.setSize(from.getSize());
        }
        if (from.isSetTotal()) {
            to.setTotal(from.getTotal());
        }
        to.getOpenStackSubnets().addAll(adaptIn(from.getOpenStackSubnets()));
        return to;
    }
}
