static ReviewDeleteCommand ofKey(final String key, final Long version) { final Versioned<Review> versioned = Versioned.of("key=" + key, version);//hack for simple reuse return of(versioned); } }
/** Creates a command object to delete a {@link Payment} by its key. @param key the key of the Payment to delete, see {@link Payment#getKey()} @param version `the current version of the Payment, see {@link Payment#getVersion()} @return delete command */ static PaymentDeleteCommand ofKey(final String key, final Long version) { final Versioned<Payment> versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse return of(versioned); }
/** Creates a command object to delete a {@link Payment} by its key. @param key the key of the Payment to delete, see {@link Payment#getKey()} @param version the current version of the Payment, see {@link Payment#getVersion()} @param eraseData If set to {@literal true}, the commercetools platform guarantees that all personal data related to the particular object, including invisible data, is erased, in compliance with the GDPR. @return delete command */ static PaymentDeleteCommand ofKey(final String key, final Long version, final boolean eraseData) { final Versioned<Payment> versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse return of(versioned, eraseData); }
/** Creates a command to update a Order selected by its orderNumber using several update actions. @param orderNumber the orderNumber of the Order to update, see {@link Order#getOrderNumber()} @param version the current version of the Order, see {@link Order#getVersion()} @param updateActions the updates @return the update command for Order */ static OrderUpdateCommand ofOrderNumber(final String orderNumber, final Long version, final List<? extends UpdateAction<Order>> updateActions) { final Versioned<Order> versioned = Versioned.of("order-number=" + urlEncode(orderNumber), version);//hack for simple reuse return new OrderUpdateCommandImpl(versioned, updateActions); }
/** Creates a command object to delete a {@link Review} by its id. @param id the id of the Review to delete, see {@link Review#getId()} @param version the current version of the Review, see {@link Review#getVersion()} @param eraseData If set to {@literal true}, the commercetools platform guarantees that all personal data related to the particular object, including invisible data, is erased, in compliance with the GDPR. @return delete command */ static ReviewDeleteCommand ofId(final String id, final Long version, final boolean eraseData) { final Versioned<Review> versioned = Versioned.of("id=" + urlEncode(id), version);//hack for simple reuse return of(versioned, eraseData); }
/** Creates a command object to delete a {@link Subscription} by its key. @param key the key of the Subscription to delete, see {@link Subscription#getKey()} @param version `the current version of the Subscription, see {@link Subscription#getVersion()} @return delete command */ static SubscriptionDeleteCommand ofKey(final String key, final Long version) { final Versioned<Subscription> versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse return of(versioned); }
/** Creates a command to update a Customer selected by its key using several update actions. @param key the key of the Customer to update, see {@link Customer#getKey()} @param version the current version of the Customer, see {@link Customer#getVersion()} @param updateActions the updates @return the update command for Customer */ static CustomerUpdateCommand ofKey(final String key, final Long version, final List<? extends UpdateAction<Customer>> updateActions) { final Versioned<Customer> versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse return new CustomerUpdateCommandImpl(versioned, updateActions); }
/** Creates a command object to delete a {@link Order} by its orderNumber. @param orderNumber the orderNumber of the Order to delete, see {@link Order#getOrderNumber()} @param version `the current version of the Order, see {@link Order#getVersion()} @return delete command */ static OrderDeleteCommand ofOrderNumber(final String orderNumber, final Long version) { final Versioned<Order> versioned = Versioned.of("order-number=" + urlEncode(orderNumber), version);//hack for simple reuse return of(versioned); }
/** Creates a command object to delete a {@link ProductType} by its key. @param key the key of the ProductType to delete, see {@link ProductType#getKey()} @param version `the current version of the ProductType, see {@link ProductType#getVersion()} @return delete command */ static ProductTypeDeleteCommand ofKey(final String key, final Long version) { final Versioned<ProductType> versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse return of(versioned); }
/** Creates a command object to delete a {@link Review} by its id. @param id the id of the Review to delete, see {@link Review#getId()} @param version `the current version of the Review, see {@link Review#getVersion()} @return delete command */ static ReviewDeleteCommand ofId(final String id, final Long version) { final Versioned<Review> versioned = Versioned.of("id=" + urlEncode(id), version);//hack for simple reuse return of(versioned); }
/** Creates a command object to delete a {@link ShoppingList} by its key. @param key the key of the ShoppingList to delete, see {@link ShoppingList#getKey()} @param version `the current version of the ShoppingList, see {@link ShoppingList#getVersion()} @return delete command */ static ShoppingListDeleteCommand ofKey(final String key, final Long version) { final Versioned<ShoppingList> versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse return of(versioned); }
/** Creates a command object to delete a {@link Zone} by its id. @param id the id of the Zone to delete, see {@link Zone#getId()} @param version `the current version of the Zone, see {@link Zone#getVersion()} @return delete command */ static ZoneDeleteCommand ofId(final String id, final Long version) { final Versioned<Zone> versioned = Versioned.of("id=" + urlEncode(id), version);//hack for simple reuse return of(versioned); }
/** Creates a command object to delete a {@link Category} by its key. @param key the key of the Category to delete, see {@link Category#getKey()} @param version `the current version of the Category, see {@link Category#getVersion()} @return delete command */ static CategoryDeleteCommand ofKey(final String key, final Long version) { final Versioned<Category> versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse return of(versioned); }
/** Creates a command object to delete a {@link Type} by its key. @param key the key of the Type to delete, see {@link Type#getKey()} @param version `the current version of the Type, see {@link Type#getVersion()} @return delete command */ static TypeDeleteCommand ofKey(final String key, final Long version) { final Versioned<Type> versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse return of(versioned); }
/** Creates a command object to delete a {@link TaxCategory} by its key. @param key the key of the TaxCategory to delete, see {@link TaxCategory#getKey()} @param version `the current version of the TaxCategory, see {@link TaxCategory#getVersion()} @return delete command */ static TaxCategoryDeleteCommand ofKey(final String key, final Long version) { final Versioned<TaxCategory> versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse return of(versioned); }
/** Creates a command object to delete a {@link Review} by its key. @param key the key of the Review to delete, see {@link Review#getKey()} @param version the current version of the Review, see {@link Review#getVersion()} @param eraseData If set to {@literal true}, the commercetools platform guarantees that all personal data related to the particular object, including invisible data, is erased, in compliance with the GDPR. @return delete command */ static ReviewDeleteCommand ofKey(final String key, final Long version, final boolean eraseData) { final Versioned<Review> versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse return of(versioned, eraseData); }
/** Creates a command to update a Review selected by its key using several update actions. @param key the key of the Review to update, see {@link Review#getKey()} @param version the current version of the Review, see {@link Review#getVersion()} @param updateActions the updates @return the update command for Review */ static ReviewUpdateCommand ofKey(final String key, final Long version, final List<? extends UpdateAction<Review>> updateActions) { final Versioned<Review> versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse return new ReviewUpdateCommandImpl(versioned, updateActions); }
/** Creates a command to update a ShoppingList selected by its key using several update actions. @param key the key of the ShoppingList to update, see {@link ShoppingList#getKey()} @param version the current version of the ShoppingList, see {@link ShoppingList#getVersion()} @param updateActions the updates @return the update command for ShoppingList */ static ShoppingListUpdateCommand ofKey(final String key, final Long version, final List<? extends UpdateAction<ShoppingList>> updateActions) { final Versioned<ShoppingList> versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse return new ShoppingListUpdateCommandImpl(versioned, updateActions); }
/** Creates a command object to delete a {@link ShoppingList} by its id. @param id the id of the ShoppingList to delete, see {@link ShoppingList#getId()} @param version `the current version of the ShoppingList, see {@link ShoppingList#getVersion()} @return delete command */ static ShoppingListDeleteCommand ofId(final String id, final Long version) { final Versioned<ShoppingList> versioned = Versioned.of("id=" + urlEncode(id), version);//hack for simple reuse return of(versioned); }
@Test public void readAccessForUpdateActions() { final List<UpdateAction<Category>> updateActions = asList(SetMetaTitle.of(randomSlug()), SetMetaDescription.of(randomSlug())); final UpdateCommand<Category> updateCommand = CategoryUpdateCommand.of(Versioned.of("id", 4L), updateActions); assertThat(updateCommand.getUpdateActions()).isEqualTo(updateActions); }