Skip to content

Commit

Permalink
Update New Endpoints (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkVaughn authored Jul 1, 2019
1 parent 29ea60b commit 157c37c
Show file tree
Hide file tree
Showing 14 changed files with 472 additions and 0 deletions.
24 changes: 24 additions & 0 deletions php/src/Snagshout/Promote/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,30 @@ public function reviewDeal(int $campaign, \Snagshout\Promote\Model\ReviewFoundRe
{
return $this->executePsr7Endpoint(new \Snagshout\Promote\Endpoint\ReviewDeal($campaign, $body), $fetch);
}
/**
*
*
* @param \Snagshout\Promote\Model\CompleteFacebookOrderRequestBody $body
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
*
* @return null|\Psr\Http\Message\ResponseInterface
*/
public function completeFacebookOrder(\Snagshout\Promote\Model\CompleteFacebookOrderRequestBody $body, string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new \Snagshout\Promote\Endpoint\CompleteFacebookOrder($body), $fetch);
}
/**
*
*
* @param \Snagshout\Promote\Model\CreateFacebookOrderRequestBody $body
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
*
* @return null|\Psr\Http\Message\ResponseInterface
*/
public function createFacebookOrder(\Snagshout\Promote\Model\CreateFacebookOrderRequestBody $body, string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new \Snagshout\Promote\Endpoint\CreateFacebookOrder($body), $fetch);
}
/**
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
*
Expand Down
55 changes: 55 additions & 0 deletions php/src/Snagshout/Promote/Endpoint/CompleteFacebookOrder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

/**
* Copyright 2016-2018, 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\Endpoint;

class CompleteFacebookOrder extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint
{
/**
*
*
* @param \Snagshout\Promote\Model\CompleteFacebookOrderRequestBody $body
*/
public function __construct(\Snagshout\Promote\Model\CompleteFacebookOrderRequestBody $body)
{
$this->body = $body;
}

use \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait;

public function getMethod() : string
{
return 'PATCH';
}
public function getUri() : string
{
return '/facebook/order';
}
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null) : array
{
return $this->getSerializedBody($serializer);
}
public function getExtraHeaders() : array
{
return ['Accept' => ['application/json']];
}
/**
* {@inheritdoc}
*
*
*/
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer)
{
if (204 === $status) {
return null;
}
}
}
55 changes: 55 additions & 0 deletions php/src/Snagshout/Promote/Endpoint/CreateFacebookOrder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

/**
* Copyright 2016-2018, 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\Endpoint;

class CreateFacebookOrder extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint
{
/**
*
*
* @param \Snagshout\Promote\Model\CreateFacebookOrderRequestBody $body
*/
public function __construct(\Snagshout\Promote\Model\CreateFacebookOrderRequestBody $body)
{
$this->body = $body;
}

use \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait;

public function getMethod() : string
{
return 'POST';
}
public function getUri() : string
{
return '/facebook/order';
}
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null) : array
{
return $this->getSerializedBody($serializer);
}
public function getExtraHeaders() : array
{
return ['Accept' => ['application/json']];
}
/**
* {@inheritdoc}
*
*
*/
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer)
{
if (204 === $status) {
return null;
}
}
}
1 change: 1 addition & 0 deletions php/src/Snagshout/Promote/Endpoint/GetVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

class GetVersion extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint
{

use \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait;

public function getMethod() : string
Expand Down
1 change: 1 addition & 0 deletions php/src/Snagshout/Promote/Endpoint/IndexDeals.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

class IndexDeals extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint
{

use \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait;

public function getMethod() : string
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

/**
* Copyright 2016-2018, 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 CompleteFacebookOrderRequestBody
{
/**
* The Facebook shopper's email address.
*
* @var string
*/
protected $email;
/**
* The unique Facebook user ID.
*
* @var string
*/
protected $fbUserId;
/**
* The Facebook shopper's email address.
*
* @return string
*/
public function getEmail() : ? string
{
return $this->email;
}
/**
* The Facebook shopper's email address.
*
* @param string $email
*
* @return self
*/
public function setEmail(? string $email) : self
{
$this->email = $email;

return $this;
}
/**
* The unique Facebook user ID.
*
* @return string
*/
public function getFbUserId() : ? string
{
return $this->fbUserId;
}
/**
* The unique Facebook user ID.
*
* @param string $fbUserId
*
* @return self
*/
public function setFbUserId(? string $fbUserId) : self
{
$this->fbUserId = $fbUserId;

return $this;
}
}
72 changes: 72 additions & 0 deletions php/src/Snagshout/Promote/Model/CreateFacebookOrderRequestBody.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

/**
* Copyright 2016-2018, 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 CreateFacebookOrderRequestBody
{
/**
* The Facebook Ad ID.
*
* @var string
*/
protected $adId;
/**
* The Facebook unique user ID.
*
* @var string
*/
protected $userId;
/**
* The Facebook Ad ID.
*
* @return string
*/
public function getAdId() : ? string
{
return $this->adId;
}
/**
* The Facebook Ad ID.
*
* @param string $adId
*
* @return self
*/
public function setAdId(? string $adId) : self
{
$this->adId = $adId;

return $this;
}
/**
* The Facebook unique user ID.
*
* @return string
*/
public function getUserId() : ? string
{
return $this->userId;
}
/**
* The Facebook unique user ID.
*
* @param string $userId
*
* @return self
*/
public function setUserId(? string $userId) : self
{
$this->userId = $userId;

return $this;
}
}
28 changes: 28 additions & 0 deletions php/src/Snagshout/Promote/Model/Deal.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ class Deal
* @var bool
*/
protected $available;
/**
*
*
* @var mixed
*/
protected $metadata;
/**
*
*
Expand Down Expand Up @@ -933,6 +939,28 @@ public function setAvailable(? bool $available) : self

return $this;
}
/**
*
*
* @return mixed
*/
public function getMetadata()
{
return $this->metadata;
}
/**
*
*
* @param mixed $metadata
*
* @return self
*/
public function setMetadata($metadata) : self
{
$this->metadata = $metadata;

return $this;
}
/**
*
*
Expand Down
28 changes: 28 additions & 0 deletions php/src/Snagshout/Promote/Model/SyncDealRequestBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ class SyncDealRequestBody
* @var string
*/
protected $url;
/**
* Campaign note.
*
* @var string
*/
protected $note;
/**
* Deal state on the partner site.
*
Expand Down Expand Up @@ -47,6 +53,28 @@ public function setUrl(? string $url) : self

return $this;
}
/**
* Campaign note.
*
* @return string
*/
public function getNote() : ? string
{
return $this->note;
}
/**
* Campaign note.
*
* @param string $note
*
* @return self
*/
public function setNote(? string $note) : self
{
$this->note = $note;

return $this;
}
/**
* Deal state on the partner site.
*
Expand Down
Loading

0 comments on commit 157c37c

Please sign in to comment.