Skip to content

Commit

Permalink
Change Namespace, Add Users Endpoint (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkVaughn authored Jun 27, 2017
1 parent 1b8485d commit d5b183e
Show file tree
Hide file tree
Showing 30 changed files with 477 additions and 171 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
],
"autoload": {
"psr-4": {
"SellerLabs\\Promote\\": "php/src/SellerLabs/Promote",
"Tests\\SellerLabs\\Promote\\": "php/tests/SellerLabs/Promote"
"Snagshout\\Promote\\": "php/src/Snagshout/Promote",
"Tests\\Snagshout\\Promote\\": "php/tests/Snagshout/Promote"
}
},
"minimum-stability": "stable"
Expand Down
13 changes: 13 additions & 0 deletions php/.formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use-sort:
sort-type: alph
sort-direction: asc

header: |
/**
* Copyright 2016-2017, Snagshout <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* This file is part of the Merchant package
*/
4 changes: 2 additions & 2 deletions php/.jane-openapi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

return [
'openapi-file' => __DIR__ . '/swagger.json',
'namespace' => 'SellerLabs\Promote',
'directory' => __DIR__ . '/src/SellerLabs/Promote',
'namespace' => 'Snagshout\Promote',
'directory' => __DIR__ . '/src/Snagshout/Promote',
'date-format' => \DateTime::RFC3339,
'reference' => false,
];
6 changes: 3 additions & 3 deletions php/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
clean:
rm -rf src/SellerLabs/Promote/Model
rm -rf src/SellerLabs/Promote/Normalizer
rm -rf src/SellerLabs/Promote/Resource
rm -rf src/Snagshout/Promote/Model
rm -rf src/Snagshout/Promote/Normalizer
rm -rf src/Snagshout/Promote/Resource

all:
curl -o swagger.json http://localhost:8000/documentation
Expand Down
2 changes: 1 addition & 1 deletion php/examples/simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

require_once __DIR__ . '/../../vendor/autoload.php';

use SellerLabs\Promote\Client;
use Snagshout\Promote\Client;

$client = new Client(
"b7b8c99469b430c3f4c8132527c7fab6c5963416db63425ca4dd7df2f09ce1bb7ca9581463f4844c733a073434ab419cee9d63f44435bea65c0799b083a9bddf",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
<?php

/**
* Copyright 2014-2017, SellerLabs <sellerlabs-devs@sellerlabs.com>
* Copyright 2016-2017, Snagshout <developers@snagshout.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* This file is part of the Promote package
* This file is part of the Merchant package
*/

namespace SellerLabs\Promote;
namespace Snagshout\Promote;

use Closure;
use DateTime;
use GuzzleHttp\Client as HttpClient;
use Http\Adapter\Guzzle6\Client as GuzzleAdapter;
use GuzzleHttp\Handler\CurlHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Uri;
use Http\Adapter\Guzzle6\Client as GuzzleAdapter;
use Http\Message\MessageFactory\GuzzleMessageFactory;
use Joli\Jane\OpenApi\Runtime\Client\Resource;
use Joli\Jane\Runtime\Encoder\RawEncoder;
use Psr\Http\Message\RequestInterface;
use SellerLabs\Promote\Normalizer\NormalizerFactory;
use SellerLabs\Promote\Resource\DealsResource;
use SellerLabs\Promote\Resource\DefaultResource;
use SellerLabs\Promote\Resource\FrontResource;
use Snagshout\Promote\Normalizer\NormalizerFactory;
use Snagshout\Promote\Resource\DealsResource;
use Snagshout\Promote\Resource\FrontResource;
use Snagshout\Promote\Resource\UsersResource;
use Symfony\Component\Serializer\Encoder\JsonDecode;
use Symfony\Component\Serializer\Encoder\JsonEncode;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Serializer;

/**
* Class Client
* Class Client.
*
* @package SellerLabs\Promote
* @package Snagshout\Promote
*
* @author Eduardo Trujillo <[email protected]>
*/
Expand Down Expand Up @@ -187,6 +187,14 @@ protected function buildResource($resourceClass)
);
}

/**
* @return DealsResource|Resource
*/
public function deals()
{
return $this->buildResource(DealsResource::class);
}

/**
* @return FrontResource|Resource
*/
Expand All @@ -196,10 +204,10 @@ public function front()
}

/**
* @return DealsResource|Resource
* @return UsersResource|Resource
*/
public function deals()
public function users()
{
return $this->buildResource(DealsResource::class);
return $this->buildResource(UsersResource::class);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<?php

namespace SellerLabs\Promote\Model;
/**
* Copyright 2016-2017, Snagshout <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* This file is part of the Merchant package
*/

namespace Snagshout\Promote\Model;

class Category
{
Expand All @@ -27,6 +36,7 @@ public function getId()
public function setId($id = null)
{
$this->id = $id;

return $this;
}
/**
Expand All @@ -44,6 +54,7 @@ public function getName()
public function setName($name = null)
{
$this->name = $name;

return $this;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<?php

namespace SellerLabs\Promote\Model;
/**
* Copyright 2016-2017, Snagshout <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* This file is part of the Merchant package
*/

namespace Snagshout\Promote\Model;

class Deal
{
Expand Down Expand Up @@ -115,6 +124,7 @@ public function getCampaignId()
public function setCampaignId($campaignId = null)
{
$this->campaignId = $campaignId;

return $this;
}
/**
Expand All @@ -132,6 +142,7 @@ public function getProductName()
public function setProductName($productName = null)
{
$this->productName = $productName;

return $this;
}
/**
Expand All @@ -149,6 +160,7 @@ public function getProductDescription()
public function setProductDescription($productDescription = null)
{
$this->productDescription = $productDescription;

return $this;
}
/**
Expand All @@ -166,6 +178,7 @@ public function getCategories()
public function setCategories(array $categories = null)
{
$this->categories = $categories;

return $this;
}
/**
Expand All @@ -183,6 +196,7 @@ public function getMedia()
public function setMedia(array $media = null)
{
$this->media = $media;

return $this;
}
/**
Expand All @@ -200,6 +214,7 @@ public function getListingUrl()
public function setListingUrl($listingUrl = null)
{
$this->listingUrl = $listingUrl;

return $this;
}
/**
Expand All @@ -217,6 +232,7 @@ public function getListingMetadata()
public function setListingMetadata($listingMetadata = null)
{
$this->listingMetadata = $listingMetadata;

return $this;
}
/**
Expand All @@ -234,6 +250,7 @@ public function getCurrency()
public function setCurrency($currency = null)
{
$this->currency = $currency;

return $this;
}
/**
Expand All @@ -251,6 +268,7 @@ public function getListingPrice()
public function setListingPrice($listingPrice = null)
{
$this->listingPrice = $listingPrice;

return $this;
}
/**
Expand All @@ -268,6 +286,7 @@ public function getDiscountPrice()
public function setDiscountPrice($discountPrice = null)
{
$this->discountPrice = $discountPrice;

return $this;
}
/**
Expand All @@ -285,6 +304,7 @@ public function getShippingPrice()
public function setShippingPrice($shippingPrice = null)
{
$this->shippingPrice = $shippingPrice;

return $this;
}
/**
Expand All @@ -302,6 +322,7 @@ public function getShippingDaysMin()
public function setShippingDaysMin($shippingDaysMin = null)
{
$this->shippingDaysMin = $shippingDaysMin;

return $this;
}
/**
Expand All @@ -319,6 +340,7 @@ public function getShippingDaysMax()
public function setShippingDaysMax($shippingDaysMax = null)
{
$this->shippingDaysMax = $shippingDaysMax;

return $this;
}
/**
Expand All @@ -336,6 +358,7 @@ public function getShippingType()
public function setShippingType($shippingType = null)
{
$this->shippingType = $shippingType;

return $this;
}
/**
Expand All @@ -353,6 +376,7 @@ public function getMarketplace()
public function setMarketplace($marketplace = null)
{
$this->marketplace = $marketplace;

return $this;
}
/**
Expand All @@ -370,6 +394,7 @@ public function getPayloadType()
public function setPayloadType($payloadType = null)
{
$this->payloadType = $payloadType;

return $this;
}
/**
Expand All @@ -387,6 +412,7 @@ public function getRequireEmail()
public function setRequireEmail($requireEmail = null)
{
$this->requireEmail = $requireEmail;

return $this;
}
/**
Expand All @@ -404,6 +430,7 @@ public function getStartsAt()
public function setStartsAt($startsAt = null)
{
$this->startsAt = $startsAt;

return $this;
}
/**
Expand All @@ -421,6 +448,7 @@ public function getReturnAt()
public function setReturnAt($returnAt = null)
{
$this->returnAt = $returnAt;

return $this;
}
/**
Expand All @@ -438,6 +466,7 @@ public function getUpdatedAt()
public function setUpdatedAt($updatedAt = null)
{
$this->updatedAt = $updatedAt;

return $this;
}
/**
Expand All @@ -455,6 +484,7 @@ public function getEndsAt()
public function setEndsAt($endsAt = null)
{
$this->endsAt = $endsAt;

return $this;
}
/**
Expand All @@ -472,6 +502,7 @@ public function getAvailable()
public function setAvailable($available = null)
{
$this->available = $available;

return $this;
}
/**
Expand All @@ -489,6 +520,7 @@ public function getRemainingQuantity()
public function setRemainingQuantity($remainingQuantity = null)
{
$this->remainingQuantity = $remainingQuantity;

return $this;
}
/**
Expand All @@ -506,6 +538,7 @@ public function getDailyLimitReached()
public function setDailyLimitReached($dailyLimitReached = null)
{
$this->dailyLimitReached = $dailyLimitReached;

return $this;
}
}
}
Loading

0 comments on commit d5b183e

Please sign in to comment.