src/test/java/com/squareup/connect/api/CatalogApiTest.java
@Test
    public void batchUpsertCatalogObjectsTest() throws ApiException {
        List<CatalogObjectBatch> batches = new ArrayList<>();

        int numObjects = 0;
        for (int batchNum = 0; batchNum < 3; batchNum++) {
            CatalogObjectBatch batch = new CatalogObjectBatch();
            batches.add(batch);

            for (int i = 0; i < 100; i++) {
                String itemId = "#Item-" + batchNum + "-" + i;
                String variationId = "#ItemVariation-" + batchNum + "-" + i;

                batch.addObjectsItem(new CatalogObject()
                    .type("ITEM")
                    .id(itemId)
                    .itemData(new CatalogItem()
                        .name("Item-" + batchNum + "-" + i)
                        .addVariationsItem(new CatalogObject()
                            .type("ITEM_VARIATION")
                            .id(variationId)
                            .itemVariationData(new CatalogItemVariation()
                                .itemId(itemId)
                                .name("Regular")
                                .pricingType("VARIABLE_PRICING")))));
                numObjects++;
            }
        }

        BatchUpsertCatalogObjectsRequest body = new BatchUpsertCatalogObjectsRequest()
            .idempotencyKey(UUID.randomUUID().toString())
            .batches(batches);
        BatchUpsertCatalogObjectsResponse response = api.batchUpsertCatalogObjects(body);

        assertEquals(numObjects, response.getObjects().size());
    }
/**
     * BatchUpsertCatalogObjects
     * <p>
     * Creates or updates up to 10,000 target objects based on the provided list of objects. The target objects are grouped into batches and each batch is inserted/updated in an all-or-nothing manner. If an object within a batch is malformed in some way, or violates a database constraint, the entire batch containing that item will be disregarded. However, other batches in the same request may still succeed. Each batch may contain up to 1,000 objects, and batches will be processed in order as long as the total object count for the request (items, variations, modifier lists, discounts, and taxes) is no more than 10,000.
     *
     * @throws ApiException if the Api call fails
     */
BatchUpsertCatalogObjects

Creates or updates up to 10,000 target objects based on the provided list of objects. The target objects are grouped into batches and each batch is inserted/updated in an all-or-nothing manner. If an object within a batch is malformed in some way, or violates a database constraint, the entire batch containing that item will be disregarded. However, other batches in the same request may still succeed. Each batch may contain up to 1,000 objects, and batches will be processed in order as long as the total object count for the request (items, variations, modifier lists, discounts, and taxes) is no more than 10,000.

@throws ApiException if the Api call fails
BatchUpsertCatalogObjects Creates or updates up to 10 000 target objects based on the provided list of objects . The target objects are grouped into batches and each batch is inserted / updated in an all - or - nothing manner . If an object within a batch is malformed in some way or violates a database constraint the entire batch containing that item will be disregarded . However other batches in the same request may still succeed . Each batch may contain up to 1 000 objects and batches will be processed in order as long as the total object count for the request ( items variations modifier lists discounts and taxes ) is no more than 10 000 . @throws ApiException if the Api call fails
@Test
    public void batchUpsertCatalogObjectsTest() throws ApiException {
        List<CatalogObjectBatch> batches = new ArrayList<>();
        int numObjects = 0;
        for (int batchNum = 0; batchNum < 3; batchNum++) {
            CatalogObjectBatch batch = new CatalogObjectBatch();
            batches.add(batch);
            for (int i = 0; i < 100; i++) {
                String itemId = "#Item-" + batchNum + "-" + i;
                String variationId = "#ItemVariation-" + batchNum + "-" + i;
                batch.addObjectsItem(new CatalogObject()
                    .type("ITEM")
                    .id(itemId)
                    .itemData(new CatalogItem()
                        .name("Item-" + batchNum + "-" + i)
                        .addVariationsItem(new CatalogObject()
                            .type("ITEM_VARIATION")
                            .id(variationId)
                            .itemVariationData(new CatalogItemVariation()
                                .itemId(itemId)
                                .name("Regular")
                                .pricingType("VARIABLE_PRICING")))));
                numObjects++;
            }
        }
        BatchUpsertCatalogObjectsRequest body = new BatchUpsertCatalogObjectsRequest()
            .idempotencyKey(UUID.randomUUID().toString())
            .batches(batches);
        BatchUpsertCatalogObjectsResponse response = api.batchUpsertCatalogObjects(body);
        assertEquals(numObjects, response.getObjects().size());
    }
@ Test public void batchUpsertCatalogObjectsTest ( ) throws ApiException { List < CatalogObjectBatch > batches = new ArrayList < > ( ) ; int numObjects = 0 ; for ( int batchNum = 0 ; batchNum < 3 ; batchNum ++ ) { CatalogObjectBatch batch = new CatalogObjectBatch ( ) ; batches . add ( batch ) ; for ( int i = 0 ; i < 100 ; i ++ ) { String itemId = "#Item-" + batchNum + "-" + i ; String variationId = "#ItemVariation-" + batchNum + "-" + i ; batch . addObjectsItem ( new CatalogObject ( ) . type ( "ITEM" ) . id ( itemId ) . itemData ( new CatalogItem ( ) . name ( "Item-" + batchNum + "-" + i ) . addVariationsItem ( new CatalogObject ( ) . type ( "ITEM_VARIATION" ) . id ( variationId ) . itemVariationData ( new CatalogItemVariation ( ) . itemId ( itemId ) . name ( "Regular" ) . pricingType ( "VARIABLE_PRICING" ) ) ) ) ) ; numObjects ++ ; } } BatchUpsertCatalogObjectsRequest body = new BatchUpsertCatalogObjectsRequest ( ) . idempotencyKey ( UUID . randomUUID ( ) . toString ( ) ) . batches ( batches ) ; BatchUpsertCatalogObjectsResponse response = api . batchUpsertCatalogObjects ( body ) ; assertEquals ( numObjects , response . getObjects ( ) . size ( ) ) ; }
BatchUpsertCatalogObjects
 <p>
 Creates or updates up to 10,000 target objects based on the provided list of objects.
BatchUpsertCatalogObjects <p > Creates or updates up to 10 000 target objects based on the provided list of objects .