All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.commercetools.sync.services.InventoryService Maven / Gradle / Ivy

Go to download

Java Library used to import and/or sync (taking care of changes) data into one or more commercetools projects from external sources such as CSV, XML, JSON, etc.. or even from an already existing commercetools project.

The newest version!
package com.commercetools.sync.services;

import com.commercetools.api.models.inventory.InventoryEntry;
import com.commercetools.api.models.inventory.InventoryEntryDraft;
import com.commercetools.api.models.inventory.InventoryEntryUpdateAction;
import com.commercetools.sync.inventories.helpers.InventoryEntryIdentifier;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.CompletionStage;
import javax.annotation.Nonnull;

public interface InventoryService {

  /**
   * Queries existing {@link InventoryEntry}'s against set of sku and supply channels.
   *
   * @param inventoryEntryIdentifiers {@link java.util.Set} of unique inventory identifiers, used in
   *     search predicate
   * @return {@link java.util.List} of matching entries or empty list when there was no matching
   *     resources.
   */
  @Nonnull
  CompletionStage> fetchInventoryEntriesByIdentifiers(
      @Nonnull final Set inventoryEntryIdentifiers);

  /**
   * Creates new inventory entry from {@code inventoryEntryDraft}.
   *
   * @param inventoryEntryDraft draft with data for new inventory entry
   * @return {@link java.util.concurrent.CompletionStage} with created {@link InventoryEntry} or an
   *     exception
   */
  @Nonnull
  CompletionStage> createInventoryEntry(
      @Nonnull final InventoryEntryDraft inventoryEntryDraft);

  /**
   * Updates existing inventory entry with {@code updateActions}.
   *
   * @param inventoryEntry entry that should be updated
   * @param updateActions {@link java.util.List} of actions that should be applied to {@code
   *     inventoryEntry}
   * @return {@link java.util.concurrent.CompletionStage} with updated {@link InventoryEntry} or an
   *     exception
   */
  @Nonnull
  CompletionStage updateInventoryEntry(
      @Nonnull final InventoryEntry inventoryEntry,
      @Nonnull final List updateActions);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy