Examples of ManagedObjectRepresentation


Examples of com.cumulocity.rest.representation.inventory.ManagedObjectRepresentation

        return restConnector.get(path, InventoryMediaType.MANAGED_OBJECT_REFERENCE, ManagedObjectReferenceRepresentation.class);
    }

    @Override
    public void deleteChildDevice(GId deviceId) throws SDKException {
        ManagedObjectRepresentation managedObjectRepresentation = get();
        String path = createChildDevicePath(managedObjectRepresentation) + "/" + deviceId.getValue();
        restConnector.delete(path);
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.inventory.ManagedObjectRepresentation

    }

    @Override
    public ManagedObjectReferenceRepresentation addChildAssets(ManagedObjectReferenceRepresentation refrenceReprsentation)
            throws SDKException {
        ManagedObjectRepresentation managedObjectRepresentation = get();
        return restConnector.post(createChildAssetPath(managedObjectRepresentation), InventoryMediaType.MANAGED_OBJECT_REFERENCE,
                refrenceReprsentation);
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.inventory.ManagedObjectRepresentation

    }
   
    @Override
    public ManagedObjectReferenceRepresentation addChildAssets(GId childId)
            throws SDKException {
        ManagedObjectRepresentation managedObjectRepresentation = get();
        return restConnector.post(createChildAssetPath(managedObjectRepresentation), InventoryMediaType.MANAGED_OBJECT_REFERENCE,
                createChildObject(childId));
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.inventory.ManagedObjectRepresentation

                createChildObject(childId));
    }
   
    private ManagedObjectReferenceRepresentation createChildObject(GId childId) {
        ManagedObjectReferenceRepresentation morr = new ManagedObjectReferenceRepresentation();
        ManagedObjectRepresentation mor = new ManagedObjectRepresentation();
        mor.setId(childId);
        morr.setManagedObject(mor);
        return morr;
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.inventory.ManagedObjectRepresentation

        return managedObjectRepresentation.getChildAssets().getSelf();
    }

    @Override
    public ManagedObjectReferenceCollection getChildAssets() throws SDKException {
        ManagedObjectRepresentation managedObjectRepresentation = get();
        String self = createChildAssetPath(managedObjectRepresentation);
        return new ManagedObjectReferenceCollectionImpl(restConnector,self, pageSize);
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.inventory.ManagedObjectRepresentation

        return new ManagedObjectReferenceCollectionImpl(restConnector,self, pageSize);
    }

    @Override
    public ManagedObjectReferenceRepresentation getChildAsset(GId assetId) throws SDKException {
        ManagedObjectRepresentation managedObjectRepresentation = get();
        String path = createChildAssetPath(managedObjectRepresentation) + "/" + assetId.getValue();
        return restConnector.get(path, InventoryMediaType.MANAGED_OBJECT_REFERENCE, ManagedObjectReferenceRepresentation.class);
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.inventory.ManagedObjectRepresentation

        return restConnector.get(path, InventoryMediaType.MANAGED_OBJECT_REFERENCE, ManagedObjectReferenceRepresentation.class);
    }

    @Override
    public void deleteChildAsset(GId assetId) throws SDKException {
        ManagedObjectRepresentation managedObjectRepresentation = get();
        String path = createChildAssetPath(managedObjectRepresentation) + "/" + assetId.getValue();
        restConnector.delete(path);
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.inventory.ManagedObjectRepresentation

    @Before
    public void setUp() throws Exception {
        inventory = platform.getInventoryApi();

        ManagedObjectRepresentation parentRep = inventory.create(aSampleMo().withName("parentRep").build());
        parentMo = inventory.getManagedObject(parentRep.getId());
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.inventory.ManagedObjectRepresentation

    private void addingSameItemTwiceHasNoEffect(ChildAdder childAdder, ChildrenQuery childrenQuery)
            throws SDKException {

        // Given
        ManagedObjectRepresentation ch1 = inventory.create(aSampleMo().build());
        ManagedObjectRepresentation ch2 = inventory.create(aSampleMo().build());
        ManagedObjectReferenceRepresentation childRef1 = createChildRef(ch1);
        ManagedObjectReferenceRepresentation childRef2 = createChildRef(ch2);

        // When
        childAdder.addChild(childRef1);
        childAdder.addChild(childRef2);
        childAdder.addChild(childRef1);

        // Then
        List<GId> childIds = getIdsOfChildren(childrenQuery);
        assertThat(childIds, is(asList(ch1.getId(), ch2.getId())));
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.inventory.ManagedObjectRepresentation

    }

    private List<GId> addChildrenToParent(ChildAdder childrenAdder) throws SDKException {
        List<GId> creationOrder = new LinkedList<GId>();
        for (int i = 1; i <= 20; i++) {
            ManagedObjectRepresentation child = inventory.create(aSampleMo().build());
            creationOrder.add(child.getId());
            ManagedObjectReferenceRepresentation childRef = createChildRef(child);

            childrenAdder.addChild(childRef);
        }
        return creationOrder;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.