Skip to content

Commit

Permalink
Updated Auto Generated Code
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Jun 15, 2022
1 parent d52c41f commit a7b2e1b
Show file tree
Hide file tree
Showing 8 changed files with 297 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Definitions/FortifiApiDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class FortifiApiDefinition extends ApiDefinition
public function __construct()
{
$this->setTitle('Fortifi API');
$this->setVersion('3.98.0');
$this->setVersion('3.100.0');
$this->setDescription(<<<DESCRIPTION
The second version of the Fortifi API is an exciting step forward towards
making it easier for businesses to have open access to their data. We created it
Expand Down
28 changes: 28 additions & 0 deletions src/Endpoints/ContactsDeviceEndpoint.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
namespace Fortifi\Api\V1\Endpoints;

use Fortifi\Api\Core\ApiEndpoint;

class ContactsDeviceEndpoint extends ApiEndpoint
{
protected $_path = 'contacts/device';
protected $_replacements = [];

public function __construct()
{
}

/**
* @param $hardwareId
*
* @return ContactsDeviceHardwareIdEndpoint
*/
public function with($hardwareId)
{
$endpoint = new ContactsDeviceHardwareIdEndpoint(
$hardwareId
);
$endpoint->_buildFromEndpoint($this);
return $endpoint;
}
}
91 changes: 91 additions & 0 deletions src/Endpoints/ContactsDeviceHardwareIdEndpoint.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?php
namespace Fortifi\Api\V1\Endpoints;

use Fortifi\Api\Core\ApiRequestDetail;
use Fortifi\Api\Core\ApiRequest;
use Fortifi\Api\Core\ApiEndpoint;

class ContactsDeviceHardwareIdEndpoint extends ApiEndpoint
{
protected $_path = 'contacts/device/{hardwareId}';
protected $_replacements = [];

public function __construct($hardwareId)
{
$this->_replacements['{hardwareId}'] = $hardwareId;
}

/**
* @summary Unsubscribe a device
*
* @param $unsubscribeType
* @param $brandFid
* @param $groupFid
*
* @return ApiRequest
*/
public function setUnsubscribe($unsubscribeType = null, $brandFid = null, $groupFid = null)
{
$request = new ApiRequest();
$request->setConnection($this->_getConnection());
$request->setEndpoint($this);

$detail = new ApiRequestDetail();
$detail->setRequireAuth(true);
$detail->setUrl($this->_buildUrl(
str_replace(
array_keys($this->_replacements),
array_values($this->_replacements),
'contacts/device/{hardwareId}/unsubscribe'
)
));
$detail->addPostField('unsubscribeType', $unsubscribeType);
$detail->addPostField('brandFid', $brandFid);
$detail->addPostField('groupFid', $groupFid);
$detail->setMethod('PUT');
$request->setRequestDetail($detail);
return $request;
}

/**
* @summary Subscribe an device
*
* @param $brandFid
* @param $groupFid
* @param $userAgent
* @param $encoding
* @param $language
* @param $clientIp
* @param $optInStatus
* @param $optInData
*
* @return ApiRequest
*/
public function setSubscribe($brandFid = null, $groupFid = null, $userAgent = null, $encoding = null, $language = null, $clientIp = null, $optInStatus = null, $optInData = null)
{
$request = new ApiRequest();
$request->setConnection($this->_getConnection());
$request->setEndpoint($this);

$detail = new ApiRequestDetail();
$detail->setRequireAuth(true);
$detail->setUrl($this->_buildUrl(
str_replace(
array_keys($this->_replacements),
array_values($this->_replacements),
'contacts/device/{hardwareId}/subscribe'
)
));
$detail->addPostField('brandFid', $brandFid);
$detail->addPostField('groupFid', $groupFid);
$detail->addPostField('userAgent', $userAgent);
$detail->addPostField('encoding', $encoding);
$detail->addPostField('language', $language);
$detail->addPostField('clientIp', $clientIp);
$detail->addPostField('optInStatus', $optInStatus);
$detail->addPostField('optInData', $optInData);
$detail->setMethod('PUT');
$request->setRequestDetail($detail);
return $request;
}
}
10 changes: 10 additions & 0 deletions src/Endpoints/ContactsEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,14 @@ public function with($contactFid)
$endpoint->_buildFromEndpoint($this);
return $endpoint;
}

/**
* @return ContactsDeviceEndpoint
*/
public function device()
{
$endpoint = new ContactsDeviceEndpoint();
$endpoint->_buildFromEndpoint($this);
return $endpoint;
}
}
14 changes: 14 additions & 0 deletions src/Endpoints/DeviceEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ public function __construct()
{
}

/**
* @param $hardwareId
*
* @return DeviceHardwareIdEndpoint
*/
public function with($hardwareId)
{
$endpoint = new DeviceHardwareIdEndpoint(
$hardwareId
);
$endpoint->_buildFromEndpoint($this);
return $endpoint;
}

/**
* @return DeviceUpsertEndpoint
*/
Expand Down
45 changes: 45 additions & 0 deletions src/Endpoints/DeviceHardwareIdEndpoint.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
namespace Fortifi\Api\V1\Endpoints;

use Fortifi\Api\Core\ApiRequestDetail;
use Fortifi\Api\Core\ApiRequest;
use Fortifi\Api\Core\ApiEndpoint;

class DeviceHardwareIdEndpoint extends ApiEndpoint
{
protected $_path = 'device/{hardwareId}';
protected $_replacements = [];

public function __construct($hardwareId)
{
$this->_replacements['{hardwareId}'] = $hardwareId;
}

/**
* @summary Remove a Device
*
* @param $entityFid
*
* @return ApiRequest
*/
public function delete($entityFid = null)
{
$request = new ApiRequest();
$request->setConnection($this->_getConnection());
$request->setEndpoint($this);

$detail = new ApiRequestDetail();
$detail->setRequireAuth(true);
$detail->setUrl($this->_buildUrl(
str_replace(
array_keys($this->_replacements),
array_values($this->_replacements),
'device/{hardwareId}'
)
));
$detail->addPostField('entityFid', $entityFid);
$detail->setMethod('DELETE');
$request->setRequestDetail($detail);
return $request;
}
}
5 changes: 4 additions & 1 deletion src/Payloads/UpsertDevicePayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,11 @@ public function jsonSerialize()
];
}

const PUSH_SOURCE_APPLE = 'apple';
const PUSH_SOURCE_FIREBASE = 'firebase';

/**
* @param string $value
* @param string $value apple, firebase
*
* @return $this
*/
Expand Down
105 changes: 104 additions & 1 deletion swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
swagger: '2.0'
info:
title: Fortifi API
version: '3.98.0'
version: '3.100.0'
termsOfService: 'https://fortifi.io/legal/terms/api'
description: >
The second version of the Fortifi API is an exciting step forward towards
Expand Down Expand Up @@ -822,6 +822,75 @@ paths:
description: Error
schema:
$ref: '#/definitions/Envelope'

'/contacts/device/{hardwareId}/unsubscribe':
put:
summary: Unsubscribe a device
tags:
- Contacts
security:
- OAuth:
- contact
- accessToken: [ ]
consumes:
- multipart/form-data
parameters:
- $ref: '#/parameters/hardwareId'
- $ref: '#/parameters/unsubscribeType'
- name: brandFid
in: formData
type: string
description: Brand to unsubscribe the device from
- name: groupFid
in: formData
type: string
description: Group to unsubscribe the device from
responses:
200:
description: Device Unsubscribed
x-404:
description: Device not found
default:
description: Error
schema:
$ref: '#/definitions/Envelope'

'/contacts/device/{hardwareId}/subscribe':
put:
summary: Subscribe an device
tags:
- Contacts
security:
- OAuth:
- contact
- accessToken: [ ]
consumes:
- multipart/form-data
parameters:
- $ref: '#/parameters/hardwareId'
- name: brandFid
in: formData
type: string
description: Brand to subscribe the device from
- name: groupFid
in: formData
type: string
description: Group to unsubscribe the device from
- $ref: '#/parameters/userAgent'
- $ref: '#/parameters/encoding'
- $ref: '#/parameters/language'
- $ref: '#/parameters/clientIp'
- $ref: '#/parameters/optInStatus'
- $ref: '#/parameters/optInData'
responses:
200:
description: Device Subscribed
x-404:
description: Device not found
default:
description: Error
schema:
$ref: '#/definitions/Envelope'
'/customers/{customerFid}/payments/{paymentFid}/chargeback':
post:
summary: Initiate a chargeback on a payment
Expand Down Expand Up @@ -4282,6 +4351,31 @@ paths:
schema:
$ref: '#/definitions/Envelope'

'/device/{hardwareId}':
delete:
summary: Remove a Device
tags:
- Devices
security:
- OAuth:
- device
- accessToken: [ ]
parameters:
- $ref: '#/parameters/hardwareId'
- name: entityFid
in: formData
type: string
description: Entity FID assigned to the device (CST or CONT)
required: false
responses:
200:
description: Device Subscribed
x-404:
description: Device not found
default:
description: Error
schema:
$ref: '#/definitions/Envelope'
'/entities/{entityFid}/config/{sectionName}':
delete:
summary: Remove a config section, or property from an entity
Expand Down Expand Up @@ -7092,6 +7186,12 @@ parameters:
type: string
required: true
description: Email Address
hardwareId:
name: hardwareId
in: path
type: string
required: true
description: Hardware ID
deliveryFid:
name: deliveryFid
in: path
Expand Down Expand Up @@ -11244,6 +11344,9 @@ definitions:
properties:
pushSource:
type: string
enum:
- apple
- firebase
pushAuth:
type: string
deviceType:
Expand Down

0 comments on commit a7b2e1b

Please sign in to comment.