Passed
Push — develop ( a5b804...8edde8 )
by Jens
22:28 queued 09:47
created

ShippingInfoImportDraft::fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 12
ccs 10
cts 10
cp 1
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 */
4
5
namespace Commercetools\Core\Model\Order;
6
7
use Commercetools\Core\Model\Cart\DiscountedLineItemPrice;
8
use Commercetools\Core\Model\Common\JsonObject;
9
use Commercetools\Core\Model\Common\Money;
10
use Commercetools\Core\Model\ShippingMethod\ShippingMethodReference;
11
use Commercetools\Core\Model\ShippingMethod\ShippingRate;
12
use Commercetools\Core\Model\TaxCategory\TaxCategoryReference;
13
use Commercetools\Core\Model\TaxCategory\TaxRate;
14
15
/**
16
 * @package Commercetools\Core\Model\Order
17
 * @link https://docs.commercetools.com/http-api-projects-orders-import.html#shippinginfoimportdraft
18
 *
19
 * @method string getShippingMethodName()
20
 * @method ShippingInfoImportDraft setShippingMethodName(string $shippingMethodName = null)
21
 * @method Money getPrice()
22
 * @method ShippingInfoImportDraft setPrice(Money $price = null)
23
 * @method ShippingRate getShippingRate()
24
 * @method ShippingInfoImportDraft setShippingRate(ShippingRate $shippingRate = null)
25
 * @method TaxRate getTaxRate()
26
 * @method ShippingInfoImportDraft setTaxRate(TaxRate $taxRate = null)
27
 * @method TaxCategoryReference getTaxCategory()
28
 * @method ShippingInfoImportDraft setTaxCategory(TaxCategoryReference $taxCategory = null)
29
 * @method ShippingMethodReference getShippingMethod()
30
 * @method ShippingInfoImportDraft setShippingMethod(ShippingMethodReference $shippingMethod = null)
31
 * @method DeliveryCollection getDeliveries()
32
 * @method ShippingInfoImportDraft setDeliveries(DeliveryCollection $deliveries = null)
33
 * @method DiscountedLineItemPrice getDiscountedPrice()
34
 * @method ShippingInfoImportDraft setDiscountedPrice(DiscountedLineItemPrice $discountedPrice = null)
35
 * @method string getShippingMethodState()
36
 * @method ShippingInfoImportDraft setShippingMethodState(string $shippingMethodState = null)
37
 */
38
class ShippingInfoImportDraft extends JsonObject
39
{
40
    const SHIPPING_METHOD_MATCH = 'MatchesCart';
41
    const SHIPPING_METHOD_DONT_MATCH = 'DoesNotMatchCart';
42
43 27
    public function fieldDefinitions()
44
    {
45
        return [
46 27
            'shippingMethodName' => [static::TYPE => 'string'],
47 27
            'price' => [static::TYPE => Money::class],
48 27
            'shippingRate' => [static::TYPE => ShippingRate::class],
49 27
            'taxRate' => [static::TYPE => TaxRate::class],
50 27
            'taxCategory' => [static::TYPE => TaxCategoryReference::class],
51 27
            'shippingMethod' => [static::TYPE => ShippingMethodReference::class],
52 27
            'deliveries' => [static::TYPE => DeliveryCollection::class],
53 27
            'discountedPrice' => [static::TYPE => DiscountedLineItemPrice::class],
54 27
            'shippingMethodState' => [static::TYPE => 'string'],
55
        ];
56
    }
57
}
58