Добавлены методы загрузки данных веб-аналитики
This commit is contained in:
parent
a42ddcc337
commit
06e34486ac
@ -40,6 +40,7 @@ use RetailCrm\Api\ResourceGroup\Tasks;
|
|||||||
use RetailCrm\Api\ResourceGroup\Telephony;
|
use RetailCrm\Api\ResourceGroup\Telephony;
|
||||||
use RetailCrm\Api\ResourceGroup\Users;
|
use RetailCrm\Api\ResourceGroup\Users;
|
||||||
use RetailCrm\Api\ResourceGroup\Verification;
|
use RetailCrm\Api\ResourceGroup\Verification;
|
||||||
|
use RetailCrm\Api\ResourceGroup\WebAnalytics;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Client
|
* Class Client
|
||||||
@ -125,6 +126,9 @@ class Client
|
|||||||
/** @var \RetailCrm\Api\ResourceGroup\CustomMethods */
|
/** @var \RetailCrm\Api\ResourceGroup\CustomMethods */
|
||||||
public $customMethods;
|
public $customMethods;
|
||||||
|
|
||||||
|
/** @var \RetailCrm\Api\ResourceGroup\WebAnalytics */
|
||||||
|
public $webAnalytics;
|
||||||
|
|
||||||
/** @var StreamFactoryInterface */
|
/** @var StreamFactoryInterface */
|
||||||
private $streamFactory;
|
private $streamFactory;
|
||||||
|
|
||||||
@ -339,6 +343,14 @@ class Client
|
|||||||
$eventDispatcher,
|
$eventDispatcher,
|
||||||
$logger
|
$logger
|
||||||
);
|
);
|
||||||
|
$this->webAnalytics = new WebAnalytics(
|
||||||
|
$url,
|
||||||
|
$httpClient,
|
||||||
|
$requestTransformer,
|
||||||
|
$responseTransformer,
|
||||||
|
$eventDispatcher,
|
||||||
|
$logger
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
62
src/Model/Entity/WebAnalytics/ClientId.php
Normal file
62
src/Model/Entity/WebAnalytics/ClientId.php
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP version 7.3
|
||||||
|
*
|
||||||
|
* @category ClientId
|
||||||
|
* @package RetailCrm\Api\Model\Entity\WebAnalytics
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace RetailCrm\Api\Model\Entity\WebAnalytics;
|
||||||
|
|
||||||
|
use DateTime;
|
||||||
|
use RetailCrm\Api\Component\Serializer\Annotation as JMS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class ClientId
|
||||||
|
*
|
||||||
|
* @category ClientId
|
||||||
|
* @package RetailCrm\Api\Model\Entity\WebAnalytics
|
||||||
|
*/
|
||||||
|
class ClientId
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("value")
|
||||||
|
*/
|
||||||
|
public $value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("site")
|
||||||
|
*/
|
||||||
|
public $site;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Order
|
||||||
|
*
|
||||||
|
* @JMS\Type("RetailCrm\Api\Model\Entity\WebAnalytics\Order")
|
||||||
|
* @JMS\SerializedName("order")
|
||||||
|
*/
|
||||||
|
public $order;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Customer
|
||||||
|
*
|
||||||
|
* @JMS\Type("RetailCrm\Api\Model\Entity\WebAnalytics\Customer")
|
||||||
|
* @JMS\SerializedName("customer")
|
||||||
|
*/
|
||||||
|
public $customer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var DateTime
|
||||||
|
*
|
||||||
|
* @JMS\Type("DateTime<'Y-m-d H:i:s'>")
|
||||||
|
* @JMS\SerializedName("createdAt")
|
||||||
|
*/
|
||||||
|
public $createdAt;
|
||||||
|
}
|
46
src/Model/Entity/WebAnalytics/Customer.php
Normal file
46
src/Model/Entity/WebAnalytics/Customer.php
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP version 7.3
|
||||||
|
*
|
||||||
|
* @category Customer
|
||||||
|
* @package RetailCrm\Api\Model\Entity\WebAnalytics
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace RetailCrm\Api\Model\Entity\WebAnalytics;
|
||||||
|
|
||||||
|
use DateTime;
|
||||||
|
use RetailCrm\Api\Component\Serializer\Annotation as JMS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Customer
|
||||||
|
*
|
||||||
|
* @category Customer
|
||||||
|
* @package RetailCrm\Api\Model\Entity\WebAnalytics
|
||||||
|
*/
|
||||||
|
class Customer
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*
|
||||||
|
* @JMS\Type("int")
|
||||||
|
* @JMS\SerializedName("id")
|
||||||
|
*/
|
||||||
|
public $id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("externalId")
|
||||||
|
*/
|
||||||
|
public $externalId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("type")
|
||||||
|
*/
|
||||||
|
public $type;
|
||||||
|
}
|
46
src/Model/Entity/WebAnalytics/Order.php
Normal file
46
src/Model/Entity/WebAnalytics/Order.php
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP version 7.3
|
||||||
|
*
|
||||||
|
* @category Order
|
||||||
|
* @package RetailCrm\Api\Model\Entity\WebAnalytics
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace RetailCrm\Api\Model\Entity\WebAnalytics;
|
||||||
|
|
||||||
|
use DateTime;
|
||||||
|
use RetailCrm\Api\Component\Serializer\Annotation as JMS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Order
|
||||||
|
*
|
||||||
|
* @category Order
|
||||||
|
* @package RetailCrm\Api\Model\Entity\WebAnalytics
|
||||||
|
*/
|
||||||
|
class Order
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*
|
||||||
|
* @JMS\Type("int")
|
||||||
|
* @JMS\SerializedName("id")
|
||||||
|
*/
|
||||||
|
public $id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("externalId")
|
||||||
|
*/
|
||||||
|
public $externalId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("number")
|
||||||
|
*/
|
||||||
|
public $number;
|
||||||
|
}
|
93
src/Model/Entity/WebAnalytics/Source.php
Normal file
93
src/Model/Entity/WebAnalytics/Source.php
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP version 7.3
|
||||||
|
*
|
||||||
|
* @category Source
|
||||||
|
* @package RetailCrm\Api\Model\Entity\WebAnalytics
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace RetailCrm\Api\Model\Entity\WebAnalytics;
|
||||||
|
|
||||||
|
use RetailCrm\Api\Component\Serializer\Annotation as JMS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Source
|
||||||
|
*
|
||||||
|
* @category Source
|
||||||
|
* @package RetailCrm\Api\Model\Entity\WebAnalytics
|
||||||
|
*/
|
||||||
|
class Source
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("source")
|
||||||
|
*/
|
||||||
|
public $source;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("medium")
|
||||||
|
*/
|
||||||
|
public $medium;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("campaign")
|
||||||
|
*/
|
||||||
|
public $campaign;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("keyword")
|
||||||
|
*/
|
||||||
|
public $keyword;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("content")
|
||||||
|
*/
|
||||||
|
public $content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("site")
|
||||||
|
*/
|
||||||
|
public $site;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("clientId")
|
||||||
|
*/
|
||||||
|
public $clientId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Order
|
||||||
|
*
|
||||||
|
* @JMS\Type("RetailCrm\Api\Model\Entity\WebAnalytics\Order")
|
||||||
|
* @JMS\SerializedName("order")
|
||||||
|
*/
|
||||||
|
public $order;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Customer
|
||||||
|
*
|
||||||
|
* @JMS\Type("RetailCrm\Api\Model\Entity\WebAnalytics\Customer")
|
||||||
|
* @JMS\SerializedName("customer")
|
||||||
|
*/
|
||||||
|
public $customer;
|
||||||
|
}
|
43
src/Model/Request/WebAnalytics/ClientIdUploadRequest.php
Normal file
43
src/Model/Request/WebAnalytics/ClientIdUploadRequest.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP version 7.3
|
||||||
|
*
|
||||||
|
* @category ClientIdUploadRequest
|
||||||
|
* @package RetailCrm\Api\Model\Request\WebAnalytics
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace RetailCrm\Api\Model\Request\WebAnalytics;
|
||||||
|
|
||||||
|
use RetailCrm\Api\Component\FormData\Mapping as Form;
|
||||||
|
use RetailCrm\Api\Interfaces\RequestInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class ClientIdUploadRequest
|
||||||
|
*
|
||||||
|
* @category ClientIdUploadRequest
|
||||||
|
* @package RetailCrm\Api\Model\Request\WebAnalytics
|
||||||
|
*/
|
||||||
|
class ClientIdUploadRequest implements RequestInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var \RetailCrm\Api\Model\Entity\WebAnalytics\ClientId[]
|
||||||
|
*
|
||||||
|
* @Form\Type("array<RetailCrm\Api\Model\Entity\WebAnalytics\ClientId>")
|
||||||
|
* @Form\SerializedName("clientIds")
|
||||||
|
* @Form\JsonField()
|
||||||
|
*/
|
||||||
|
public $clientIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClientIdUploadRequest constructor.
|
||||||
|
*
|
||||||
|
* @param \RetailCrm\Api\Model\Entity\WebAnalytics\ClientId[]|null $clientIds
|
||||||
|
*/
|
||||||
|
public function __construct(?array $clientIds = null)
|
||||||
|
{
|
||||||
|
if (null !== $clientIds) {
|
||||||
|
$this->clientIds = $clientIds;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
43
src/Model/Request/WebAnalytics/SourcesUploadRequest.php
Normal file
43
src/Model/Request/WebAnalytics/SourcesUploadRequest.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP version 7.3
|
||||||
|
*
|
||||||
|
* @category SourcesUploadRequest
|
||||||
|
* @package RetailCrm\Api\Model\Request\WebAnalytics
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace RetailCrm\Api\Model\Request\WebAnalytics;
|
||||||
|
|
||||||
|
use RetailCrm\Api\Component\FormData\Mapping as Form;
|
||||||
|
use RetailCrm\Api\Interfaces\RequestInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class SourcesUploadRequest
|
||||||
|
*
|
||||||
|
* @category SourcesUploadRequest
|
||||||
|
* @package RetailCrm\Api\Model\Request\WebAnalytics
|
||||||
|
*/
|
||||||
|
class SourcesUploadRequest implements RequestInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var \RetailCrm\Api\Model\Entity\WebAnalytics\Source[]
|
||||||
|
*
|
||||||
|
* @Form\Type("array<RetailCrm\Api\Model\Entity\WebAnalytics\Source>")
|
||||||
|
* @Form\SerializedName("sources")
|
||||||
|
* @Form\JsonField()
|
||||||
|
*/
|
||||||
|
public $sources;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SourcesUploadRequest constructor.
|
||||||
|
*
|
||||||
|
* @param \RetailCrm\Api\Model\Entity\WebAnalytics\Source[]|null $sources
|
||||||
|
*/
|
||||||
|
public function __construct(?array $sources = null)
|
||||||
|
{
|
||||||
|
if (null !== $sources) {
|
||||||
|
$this->sources = $sources;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
30
src/Model/Response/WebAnalytics/ClientIdUploadResponse.php
Normal file
30
src/Model/Response/WebAnalytics/ClientIdUploadResponse.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP version 7.3
|
||||||
|
*
|
||||||
|
* @category ClientIdUploadResponse
|
||||||
|
* @package RetailCrm\Api\Model\Response\WebAnalytics
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace RetailCrm\Api\Model\Response\WebAnalytics;
|
||||||
|
|
||||||
|
use RetailCrm\Api\Component\Serializer\Annotation as JMS;
|
||||||
|
use RetailCrm\Api\Model\Response\SuccessResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class ClientIdUploadResponse
|
||||||
|
*
|
||||||
|
* @category ClientIdUploadResponse
|
||||||
|
* @package RetailCrm\Api\Model\Response\WebAnalytics
|
||||||
|
*/
|
||||||
|
class ClientIdUploadResponse extends SuccessResponse
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var \RetailCrm\Api\Model\Entity\WebAnalytics\ClientId[]
|
||||||
|
*
|
||||||
|
* @JMS\Type("array<RetailCrm\Api\Model\Entity\WebAnalytics\ClientId>")
|
||||||
|
* @JMS\SerializedName("failedClientIds")
|
||||||
|
*/
|
||||||
|
public $failedClientIds;
|
||||||
|
}
|
30
src/Model/Response/WebAnalytics/SourcesUploadResponse.php
Normal file
30
src/Model/Response/WebAnalytics/SourcesUploadResponse.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP version 7.3
|
||||||
|
*
|
||||||
|
* @category SourcesUploadResponse
|
||||||
|
* @package RetailCrm\Api\Model\Response\WebAnalytics
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace RetailCrm\Api\Model\Response\WebAnalytics;
|
||||||
|
|
||||||
|
use RetailCrm\Api\Component\Serializer\Annotation as JMS;
|
||||||
|
use RetailCrm\Api\Model\Response\SuccessResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class SourcesUploadResponse
|
||||||
|
*
|
||||||
|
* @category SourcesUploadResponse
|
||||||
|
* @package RetailCrm\Api\Model\Response\WebAnalytics
|
||||||
|
*/
|
||||||
|
class SourcesUploadResponse extends SuccessResponse
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var \RetailCrm\Api\Model\Entity\WebAnalytics\Source[]
|
||||||
|
*
|
||||||
|
* @JMS\Type("array<RetailCrm\Api\Model\Entity\WebAnalytics\Source>")
|
||||||
|
* @JMS\SerializedName("failedSources")
|
||||||
|
*/
|
||||||
|
public $failedSources;
|
||||||
|
}
|
81
src/ResourceGroup/WebAnalytics.php
Normal file
81
src/ResourceGroup/WebAnalytics.php
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP version 7.3
|
||||||
|
*
|
||||||
|
* @category WebAnalytics
|
||||||
|
* @package RetailCrm\Api\ResourceGroup
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace RetailCrm\Api\ResourceGroup;
|
||||||
|
|
||||||
|
use RetailCrm\Api\Enum\RequestMethod;
|
||||||
|
use RetailCrm\Api\Model\Request\WebAnalytics\ClientIdUploadRequest;
|
||||||
|
use RetailCrm\Api\Model\Request\WebAnalytics\SourcesUploadRequest;
|
||||||
|
use RetailCrm\Api\Model\Response\WebAnalytics\ClientIdUploadResponse;
|
||||||
|
use RetailCrm\Api\Model\Response\WebAnalytics\SourcesUploadResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class WebAnalytics
|
||||||
|
*
|
||||||
|
* @category WebAnalytics
|
||||||
|
* @package RetailCrm\Api\ResourceGroup
|
||||||
|
*
|
||||||
|
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||||
|
*/
|
||||||
|
class WebAnalytics extends AbstractApiResourceGroup
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param \RetailCrm\Api\Model\Request\WebAnalytics\SourcesUploadRequest $request
|
||||||
|
*
|
||||||
|
* @return \RetailCrm\Api\Model\Response\WebAnalytics\SourcesUploadResponse
|
||||||
|
* @throws \RetailCrm\Api\Interfaces\ApiExceptionInterface
|
||||||
|
* @throws \RetailCrm\Api\Interfaces\ClientExceptionInterface
|
||||||
|
* @throws \RetailCrm\Api\Exception\Api\AccountDoesNotExistException
|
||||||
|
* @throws \RetailCrm\Api\Exception\Api\ApiErrorException
|
||||||
|
* @throws \RetailCrm\Api\Exception\Api\MissingCredentialsException
|
||||||
|
* @throws \RetailCrm\Api\Exception\Api\MissingParameterException
|
||||||
|
* @throws \RetailCrm\Api\Exception\Api\ValidationException
|
||||||
|
* @throws \RetailCrm\Api\Exception\Client\HandlerException
|
||||||
|
* @throws \RetailCrm\Api\Exception\Client\HttpClientException
|
||||||
|
*/
|
||||||
|
public function sourcesUpload(SourcesUploadRequest $request): SourcesUploadResponse
|
||||||
|
{
|
||||||
|
/** @var SourcesUploadResponse $response */
|
||||||
|
$response = $this->sendRequest(
|
||||||
|
RequestMethod::POST,
|
||||||
|
'web-analytics/sources/upload',
|
||||||
|
$request,
|
||||||
|
SourcesUploadResponse::class
|
||||||
|
);
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param \RetailCrm\Api\Model\Request\WebAnalytics\ClientIdUploadRequest $request
|
||||||
|
*
|
||||||
|
* @return \RetailCrm\Api\Model\Response\WebAnalytics\ClientIdUploadResponse
|
||||||
|
* @throws \RetailCrm\Api\Interfaces\ApiExceptionInterface
|
||||||
|
* @throws \RetailCrm\Api\Interfaces\ClientExceptionInterface
|
||||||
|
* @throws \RetailCrm\Api\Exception\Api\AccountDoesNotExistException
|
||||||
|
* @throws \RetailCrm\Api\Exception\Api\ApiErrorException
|
||||||
|
* @throws \RetailCrm\Api\Exception\Api\MissingCredentialsException
|
||||||
|
* @throws \RetailCrm\Api\Exception\Api\MissingParameterException
|
||||||
|
* @throws \RetailCrm\Api\Exception\Api\ValidationException
|
||||||
|
* @throws \RetailCrm\Api\Exception\Client\HandlerException
|
||||||
|
* @throws \RetailCrm\Api\Exception\Client\HttpClientException
|
||||||
|
*/
|
||||||
|
public function clientIdsUpload(ClientIdUploadRequest $request): ClientIdUploadResponse
|
||||||
|
{
|
||||||
|
/** @var ClientIdUploadResponse $response */
|
||||||
|
$response = $this->sendRequest(
|
||||||
|
RequestMethod::POST,
|
||||||
|
'web-analytics/client-ids/upload',
|
||||||
|
$request,
|
||||||
|
ClientIdUploadResponse::class
|
||||||
|
);
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user