io.sphere.sdk.products.commands.ProductCreateCommandImpl Maven / Gradle / Ivy
package io.sphere.sdk.products.commands;
import io.sphere.sdk.commands.MetaModelCreateCommandBuilder;
import io.sphere.sdk.commands.MetaModelCreateCommandImpl;
import io.sphere.sdk.products.Product;
import io.sphere.sdk.products.ProductDraft;
import io.sphere.sdk.products.expansion.ProductExpansionModel;
/**
Creates a product.
A {@link Product} must belong to a {@link io.sphere.sdk.producttypes.ProductType},
so you need to {@link io.sphere.sdk.producttypes.commands.ProductTypeCreateCommand create a product type} first if not already done.
Example usage executing the command:
{@include.example io.sphere.sdk.products.CreateProductExamples#createWithClient()}
Create a {@link ProductDraft} instance:
{@include.example io.sphere.sdk.suppliers.SimpleCottonTShirtProductDraftSupplier}
*/
final class ProductCreateCommandImpl extends MetaModelCreateCommandImpl> implements ProductCreateCommand {
ProductCreateCommandImpl(final MetaModelCreateCommandBuilder> builder) {
super(builder);
}
ProductCreateCommandImpl(final ProductDraft body) {
super(body, ProductEndpoint.ENDPOINT, ProductExpansionModel.of(), ProductCreateCommandImpl::new);
}
}