Skip to content

Commit

Permalink
Merge pull request #34 from alexagranov/v0.1.3
Browse files Browse the repository at this point in the history
Booking creation/update now accepts :name and :description; BookingRe…
  • Loading branch information
alexagranov authored Jun 19, 2017
2 parents a99e4f7 + de9bd5c commit 055fc4a
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 122 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Change Log
All notable changes to this project will be documented in this file.

## [0.1.3] - 2017-06-18 ##
### Added
- [#34](https://github.com/gonebusy/gonebusy-php-client/pull/34) - Booking creation/update now accept optional :name and :description
- [#34](https://github.com/gonebusy/gonebusy-php-client/pull/34) - Booking item response now contains :name, :description, :external_link, :collaborative_link

### Changed
- [#34](https://github.com/gonebusy/gonebusy-php-client/pull/34) - Booking :user_message has been replaced by separate :name and :description

## [0.1.2] - 2017-06-14 ##
### Changed
- [#33](https://github.com/gonebusy/gonebusy-php-client/pull/33) - Booking item response now includes :resource_id and :service_id corresponding to Resource providing the Booking and the Service being performed.
Expand Down
108 changes: 63 additions & 45 deletions src/Models/CreateBookingBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@
*/
class CreateBookingBody implements JsonSerializable
{
/**
* Desired date of booking. Several formats are supported: "2014-10-31", "October 31, 2014"
* @required
* @var string $date public property
*/
public $date;

/**
* ID of Service being booked
* @required
Expand All @@ -29,6 +22,13 @@ class CreateBookingBody implements JsonSerializable
*/
public $serviceId;

/**
* Desired date of booking. Several formats are supported: "2014-10-31", "October 31, 2014"
* @required
* @var string $date public property
*/
public $date;

/**
* Desired time of booking. Several formats are supported: '9am', '09:00', '9:00', '0900'
* @required
Expand All @@ -45,17 +45,11 @@ class CreateBookingBody implements JsonSerializable
public $userId;

/**
* Required only when :recurs_by is 'monthly' or 'yearly' to differentiate between exact date or 'day in month/year'. See Recurring Booking examples.
* @maps date_recurs_by
* @var string|null $dateRecursBy public property
*/
public $dateRecursBy;

/**
* List of comma-separated days of the week this Booking falls on. Useful for recurring Bookings. If provided, at least one must be specified.
* @var string|null $days public property
* ID of a Resource to be booked. If not provided, the first available Resource will be booked.
* @maps resource_id
* @var integer|null $resourceId public property
*/
public $days;
public $resourceId;

/**
* Length of time, in minutes, for the desired booking - if Service allows requesting a variable amount of time
Expand All @@ -70,62 +64,84 @@ class CreateBookingBody implements JsonSerializable
*/
public $endDate;

/**
* One of the possible recurrence values. If not provided, assumed to be :once to indicate a single Booking.
* @maps recurs_by
* @var string|null $recursBy public property
*/
public $recursBy;

/**
* Optional frequency of recurrence as specified by :recurs_by. E.g, :single, :every, :every_other, etc. If not provided, assumed to be :once
* @var string|null $frequency public property
*/
public $frequency;

/**
* List of comma-separated days of the week this Booking falls on. Useful for recurring Bookings. If provided, at least one must be specified.
* @var string|null $days public property
*/
public $days;

/**
* Optional occurrence of frequency. E.g, :first, :2nd, :last, :2nd_to_last, etc. If not provided, assumed to be :every
* @var string|null $occurrence public property
*/
public $occurrence;

/**
* One of the possible recurrence values. If not provided, assumed to be :once to indicate a single Booking.
* @maps recurs_by
* @var string|null $recursBy public property
* Required only when :recurs_by is 'monthly' or 'yearly' to differentiate between exact date or 'day in month/year'. See Recurring Booking examples.
* @maps date_recurs_by
* @var string|null $dateRecursBy public property
*/
public $recursBy;
public $dateRecursBy;

/**
* ID of a Resource to be booked. If not provided, the first available Resource will be booked.
* @maps resource_id
* @var integer|null $resourceId public property
* Optional name for Booking, otherwise will take name of Service.
* @var string|null $name public property
*/
public $resourceId;
public $name;

/**
* Optional description for Booking.
* @var string|null $description public property
*/
public $description;

/**
* Constructor to set initial or default values of member properties
* @param string $date Initialization value for $this->date
* @param integer $serviceId Initialization value for $this->serviceId
* @param string $date Initialization value for $this->date
* @param string $time Initialization value for $this->time
* @param integer $userId Initialization value for $this->userId
* @param string $dateRecursBy Initialization value for $this->dateRecursBy
* @param string $days Initialization value for $this->days
* @param integer $resourceId Initialization value for $this->resourceId
* @param integer $duration Initialization value for $this->duration
* @param string $endDate Initialization value for $this->endDate
* @param string $recursBy Initialization value for $this->recursBy
* @param string $frequency Initialization value for $this->frequency
* @param string $days Initialization value for $this->days
* @param string $occurrence Initialization value for $this->occurrence
* @param string $recursBy Initialization value for $this->recursBy
* @param integer $resourceId Initialization value for $this->resourceId
* @param string $dateRecursBy Initialization value for $this->dateRecursBy
* @param string $name Initialization value for $this->name
* @param string $description Initialization value for $this->description
*/
public function __construct()
{
if (12 == func_num_args()) {
$this->date = func_get_arg(0);
$this->serviceId = func_get_arg(1);
if (14 == func_num_args()) {
$this->serviceId = func_get_arg(0);
$this->date = func_get_arg(1);
$this->time = func_get_arg(2);
$this->userId = func_get_arg(3);
$this->dateRecursBy = func_get_arg(4);
$this->days = func_get_arg(5);
$this->duration = func_get_arg(6);
$this->endDate = func_get_arg(7);
$this->resourceId = func_get_arg(4);
$this->duration = func_get_arg(5);
$this->endDate = func_get_arg(6);
$this->recursBy = func_get_arg(7);
$this->frequency = func_get_arg(8);
$this->occurrence = func_get_arg(9);
$this->recursBy = func_get_arg(10);
$this->resourceId = func_get_arg(11);
$this->days = func_get_arg(9);
$this->occurrence = func_get_arg(10);
$this->dateRecursBy = func_get_arg(11);
$this->name = func_get_arg(12);
$this->description = func_get_arg(13);
}
}

Expand All @@ -136,18 +152,20 @@ public function __construct()
public function jsonSerialize()
{
$json = array();
$json['date'] = $this->date;
$json['service_id'] = $this->serviceId;
$json['date'] = $this->date;
$json['time'] = $this->time;
$json['user_id'] = $this->userId;
$json['date_recurs_by'] = $this->dateRecursBy;
$json['days'] = $this->days;
$json['resource_id'] = $this->resourceId;
$json['duration'] = $this->duration;
$json['end_date'] = $this->endDate;
$json['recurs_by'] = $this->recursBy;
$json['frequency'] = $this->frequency;
$json['days'] = $this->days;
$json['occurrence'] = $this->occurrence;
$json['recurs_by'] = $this->recursBy;
$json['resource_id'] = $this->resourceId;
$json['date_recurs_by'] = $this->dateRecursBy;
$json['name'] = $this->name;
$json['description'] = $this->description;

return $json;
}
Expand Down
80 changes: 54 additions & 26 deletions src/Models/EntitiesBookingResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ class EntitiesBookingResponse implements JsonSerializable
public $workflowState;

/**
* user requesting Booking may include a message
* @maps user_message
* @var string|null $userMessage public property
* name of Booking, if any
* @var string|null $name public property
*/
public $userMessage;
public $name;

/**
* TimeWindow corresponding to Booking
Expand All @@ -62,26 +61,52 @@ class EntitiesBookingResponse implements JsonSerializable
*/
public $serviceId;

/**
* description for Booking, if any
* @var string|null $description public property
*/
public $description;

/**
* external management link for Booking, if any
* @maps external_link
* @var string|null $externalLink public property
*/
public $externalLink;

/**
* video chat or other link associated with Booking, if any
* @maps collaborative_link
* @var string|null $collaborativeLink public property
*/
public $collaborativeLink;

/**
* Constructor to set initial or default values of member properties
* @param integer $id Initialization value for $this->id
* @param integer $ownerId Initialization value for $this->ownerId
* @param string $workflowState Initialization value for $this->workflowState
* @param string $userMessage Initialization value for $this->userMessage
* @param EntitiesTimeWindowResponse $timeWindow Initialization value for $this->timeWindow
* @param integer $resourceId Initialization value for $this->resourceId
* @param integer $serviceId Initialization value for $this->serviceId
* @param integer $id Initialization value for $this->id
* @param integer $ownerId Initialization value for $this->ownerId
* @param string $workflowState Initialization value for $this->workflowState
* @param string $name Initialization value for $this->name
* @param EntitiesTimeWindowResponse $timeWindow Initialization value for $this->timeWindow
* @param integer $resourceId Initialization value for $this->resourceId
* @param integer $serviceId Initialization value for $this->serviceId
* @param string $description Initialization value for $this->description
* @param string $externalLink Initialization value for $this->externalLink
* @param string $collaborativeLink Initialization value for $this->collaborativeLink
*/
public function __construct()
{
if (7 == func_num_args()) {
$this->id = func_get_arg(0);
$this->ownerId = func_get_arg(1);
$this->workflowState = func_get_arg(2);
$this->userMessage = func_get_arg(3);
$this->timeWindow = func_get_arg(4);
$this->resourceId = func_get_arg(5);
$this->serviceId = func_get_arg(6);
if (10 == func_num_args()) {
$this->id = func_get_arg(0);
$this->ownerId = func_get_arg(1);
$this->workflowState = func_get_arg(2);
$this->name = func_get_arg(3);
$this->timeWindow = func_get_arg(4);
$this->resourceId = func_get_arg(5);
$this->serviceId = func_get_arg(6);
$this->description = func_get_arg(7);
$this->externalLink = func_get_arg(8);
$this->collaborativeLink = func_get_arg(9);
}
}

Expand All @@ -92,13 +117,16 @@ public function __construct()
public function jsonSerialize()
{
$json = array();
$json['id'] = $this->id;
$json['owner_id'] = $this->ownerId;
$json['workflow_state'] = $this->workflowState;
$json['user_message'] = $this->userMessage;
$json['time_window'] = $this->timeWindow;
$json['resource_id'] = $this->resourceId;
$json['service_id'] = $this->serviceId;
$json['id'] = $this->id;
$json['owner_id'] = $this->ownerId;
$json['workflow_state'] = $this->workflowState;
$json['name'] = $this->name;
$json['time_window'] = $this->timeWindow;
$json['resource_id'] = $this->resourceId;
$json['service_id'] = $this->serviceId;
$json['description'] = $this->description;
$json['external_link'] = $this->externalLink;
$json['collaborative_link'] = $this->collaborativeLink;

return $json;
}
Expand Down
Loading

0 comments on commit 055fc4a

Please sign in to comment.