Skip to content

Commit

Permalink
Add getBooth call
Browse files Browse the repository at this point in the history
  • Loading branch information
marrek13 committed Nov 9, 2017
1 parent e26cd5f commit 826fdb0
Show file tree
Hide file tree
Showing 8 changed files with 183 additions and 7 deletions.
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/Shoplo/BonanzaApi/Client/BonanzaClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Shoplo\BonanzaApi\Request\EndFixedPriceItemRequest;
use Shoplo\BonanzaApi\Request\FetchTokenRequest;
use Shoplo\BonanzaApi\Request\GetBoothItemsRequest;
use Shoplo\BonanzaApi\Request\GetBoothRequest;
use Shoplo\BonanzaApi\Request\GetCategoriesRequest;
use Shoplo\BonanzaApi\Request\GetCategoryTraitsRequest;
use Shoplo\BonanzaApi\Request\GetOrdersRequest;
Expand All @@ -32,6 +33,7 @@
use Shoplo\BonanzaApi\Response\EndFixedPriceItemResponse;
use Shoplo\BonanzaApi\Response\FetchTokenResponse;
use Shoplo\BonanzaApi\Response\GetBoothItemsResponse;
use Shoplo\BonanzaApi\Response\GetBoothResponse;
use Shoplo\BonanzaApi\Response\GetCategoriesResponse;
use Shoplo\BonanzaApi\Response\GetCategoryTraitsResponse;
use Shoplo\BonanzaApi\Response\GetOrdersResponse;
Expand Down Expand Up @@ -165,6 +167,11 @@ private function post($function, $data, $isSecure = false, array $headers = []):
return $this->serializer->deserialize((string)$rsp->getBody(), $class, 'json');
}

public function getBooth(GetBoothRequest $request): GetBoothResponse
{
return $this->post(__FUNCTION__, $request);
}

public function getBoothItems(GetBoothItemsRequest $request): GetBoothItemsResponse
{
return $this->post(__FUNCTION__, $request, $request->requesterCredentials !== null);
Expand Down
17 changes: 17 additions & 0 deletions src/Shoplo/BonanzaApi/Request/GetBoothRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php


namespace Shoplo\BonanzaApi\Request;


use JMS\Serializer\Annotation as Serializer;

class GetBoothRequest
{
/**
* @var string
*
* @Serializer\Type("string")
*/
public $boothId;
}
18 changes: 18 additions & 0 deletions src/Shoplo/BonanzaApi/Response/GetBoothResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php


namespace Shoplo\BonanzaApi\Response;


use JMS\Serializer\Annotation as Serializer;
use Shoplo\BonanzaApi\Type\GetBoothResponseType;

class GetBoothResponse extends BaseResponse
{
/**
* @var GetBoothResponseType
*
* @Serializer\Type("Shoplo\BonanzaApi\Type\GetBoothResponseType")
*/
public $getBoothResponse;
}
29 changes: 29 additions & 0 deletions src/Shoplo/BonanzaApi/Type/CustomCategoryType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php


namespace Shoplo\BonanzaApi\Type;


class CustomCategoryType
{
/**
* @var int
*
* @Serializer\Type("int")
*/
public $categoryId;

/**
* @var string
*
* @Serializer\Type("string")
*/
public $name;

/**
* @var int
*
* @Serializer\Type("int")
*/
public $order;
}
17 changes: 17 additions & 0 deletions src/Shoplo/BonanzaApi/Type/GetBoothResponseType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php


namespace Shoplo\BonanzaApi\Type;


use JMS\Serializer\Annotation as Serializer;

class GetBoothResponseType extends BaseResponseType
{
/**
* @var StoreType[]
*
* @Serializer\Type("Shoplo\BonanzaApi\Type\StoreType")
*/
public $store;
}
72 changes: 72 additions & 0 deletions src/Shoplo/BonanzaApi/Type/StoreType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php


namespace Shoplo\BonanzaApi\Type;

use JMS\Serializer\Annotation as Serializer;

class StoreType
{
/**
* @var CustomCategoryType[]
*
* @Serializer\Type("array<Shoplo\BonanzaApi\Type\CustomCategoryType>")
*/
public $customCategory;

/**
* @var boolean
*
* @Serializer\Type("boolean")
*/
public $activated;

/**
* @var string
*
* @Serializer\Type("string")
*/
public $description;

/**
* @var URLType
*
* @Serializer\Type("Shoplo\BonanzaApi\Type\URLType")
*/
public $logo;

/**
* @var string
*
* @Serializer\Type("string")
*/
public $name;

/**
* @var string
*
* @Serializer\Type("string")
*/
public $policies;

/**
* @var int
*
* @Serializer\Type("int")
*/
public $subscriptionLevel;

/**
* @var boolean
*
* @Serializer\Type("boolean")
*/
public $syndicated;

/**
* @var string
*
* @Serializer\Type("string")
*/
public $url;
}
16 changes: 16 additions & 0 deletions src/Shoplo/BonanzaApi/Type/URLType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php


namespace Shoplo\BonanzaApi\Type;

use JMS\Serializer\Annotation as Serializer;

class URLType
{
/**
* @var string
*
* @Serializer\Type("string")
*/
public $url;
}

0 comments on commit 826fdb0

Please sign in to comment.