From 5257ce2b7f00488b53bfa580ad0e0003d8097773 Mon Sep 17 00:00:00 2001 From: James Eagle Date: Thu, 7 May 2026 13:56:52 +0100 Subject: [PATCH] Updated Auto Generated Code --- src/Endpoints/DeviceDevicesEndpoint.php | 28 +++++ .../DeviceDevicesHardwareIdEndpoint.php | 42 ++++++++ src/Endpoints/DeviceEndpoint.php | 20 ++++ .../DeviceStatusesDeviceFidEndpoint.php | 47 ++++++++ src/Endpoints/DeviceStatusesEndpoint.php | 28 +++++ src/Requests/ContactStatusRequest.php | 50 +++++++++ src/Requests/DeviceRequest.php | 95 +++++++++++++++++ src/Requests/DevicesRequest.php | 46 ++++++++ swagger.yaml | 100 ++++++++++++++++++ 9 files changed, 456 insertions(+) create mode 100644 src/Endpoints/DeviceDevicesEndpoint.php create mode 100644 src/Endpoints/DeviceDevicesHardwareIdEndpoint.php create mode 100644 src/Endpoints/DeviceStatusesDeviceFidEndpoint.php create mode 100644 src/Endpoints/DeviceStatusesEndpoint.php create mode 100644 src/Requests/DeviceRequest.php create mode 100644 src/Requests/DevicesRequest.php diff --git a/src/Endpoints/DeviceDevicesEndpoint.php b/src/Endpoints/DeviceDevicesEndpoint.php new file mode 100644 index 0000000..381a868 --- /dev/null +++ b/src/Endpoints/DeviceDevicesEndpoint.php @@ -0,0 +1,28 @@ +_buildFromEndpoint($this); + return $endpoint; + } +} diff --git a/src/Endpoints/DeviceDevicesHardwareIdEndpoint.php b/src/Endpoints/DeviceDevicesHardwareIdEndpoint.php new file mode 100644 index 0000000..ddba8c0 --- /dev/null +++ b/src/Endpoints/DeviceDevicesHardwareIdEndpoint.php @@ -0,0 +1,42 @@ +_replacements['{hardwareId}'] = $hardwareId; + } + + /** + * @summary Get devices by hardware ID + * + * @return DevicesRequest + */ + public function retrieve() + { + $request = new DevicesRequest(); + $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/devices/{hardwareId}' + ) + )); + $detail->setMethod('GET'); + $request->setRequestDetail($detail); + return $request; + } +} diff --git a/src/Endpoints/DeviceEndpoint.php b/src/Endpoints/DeviceEndpoint.php index 7873ba9..56ac884 100644 --- a/src/Endpoints/DeviceEndpoint.php +++ b/src/Endpoints/DeviceEndpoint.php @@ -26,6 +26,26 @@ public function with($hardwareId) return $endpoint; } + /** + * @return DeviceDevicesEndpoint + */ + public function devices() + { + $endpoint = new DeviceDevicesEndpoint(); + $endpoint->_buildFromEndpoint($this); + return $endpoint; + } + + /** + * @return DeviceStatusesEndpoint + */ + public function statuses() + { + $endpoint = new DeviceStatusesEndpoint(); + $endpoint->_buildFromEndpoint($this); + return $endpoint; + } + /** * @return DeviceUpsertEndpoint */ diff --git a/src/Endpoints/DeviceStatusesDeviceFidEndpoint.php b/src/Endpoints/DeviceStatusesDeviceFidEndpoint.php new file mode 100644 index 0000000..e2f4eca --- /dev/null +++ b/src/Endpoints/DeviceStatusesDeviceFidEndpoint.php @@ -0,0 +1,47 @@ +_replacements['{deviceFid}'] = $deviceFid; + } + + /** + * @summary List contact status + * + * @param $brandFid + * @param $groupFid + * + * @return ContactStatusesRequest + */ + public function retrieve($brandFid = null, $groupFid = null) + { + $request = new ContactStatusesRequest(); + $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/statuses/{deviceFid}' + ) + )); + $detail->addQueryField('brandFid', $brandFid); + $detail->addQueryField('groupFid', $groupFid); + $detail->setMethod('GET'); + $request->setRequestDetail($detail); + return $request; + } +} diff --git a/src/Endpoints/DeviceStatusesEndpoint.php b/src/Endpoints/DeviceStatusesEndpoint.php new file mode 100644 index 0000000..78c0dac --- /dev/null +++ b/src/Endpoints/DeviceStatusesEndpoint.php @@ -0,0 +1,28 @@ +_buildFromEndpoint($this); + return $endpoint; + } +} diff --git a/src/Requests/ContactStatusRequest.php b/src/Requests/ContactStatusRequest.php index 280c5e7..634a7dc 100644 --- a/src/Requests/ContactStatusRequest.php +++ b/src/Requests/ContactStatusRequest.php @@ -14,11 +14,39 @@ class ContactStatusRequest public function jsonSerialize() { return [ + "companyFid" => $this->getCompanyFid(), + "contactFid" => $this->getContactFid(), "groupFid" => $this->getGroupFid(), + "groupName" => $this->getGroupName(), "unsubscribed" => $this->isUnsubscribed(), + "bounced" => $this->isBounced(), ]; } + /** + * @param mixed $default + * @param bool $trim Trim Value + * + * @return string + */ + public function getCompanyFid($default = null, $trim = true) + { + $value = Objects::property($this->_getResultJson(), 'companyFid', $default); + return $trim ? Strings::ntrim($value) : $value; + } + + /** + * @param mixed $default + * @param bool $trim Trim Value + * + * @return string + */ + public function getContactFid($default = null, $trim = true) + { + $value = Objects::property($this->_getResultJson(), 'contactFid', $default); + return $trim ? Strings::ntrim($value) : $value; + } + /** * @param mixed $default * @param bool $trim Trim Value @@ -31,6 +59,18 @@ public function getGroupFid($default = null, $trim = true) return $trim ? Strings::ntrim($value) : $value; } + /** + * @param mixed $default + * @param bool $trim Trim Value + * + * @return string + */ + public function getGroupName($default = null, $trim = true) + { + $value = Objects::property($this->_getResultJson(), 'groupName', $default); + return $trim ? Strings::ntrim($value) : $value; + } + /** * @param bool $default * @@ -40,4 +80,14 @@ public function isUnsubscribed($default = false) { return Objects::property($this->_getResultJson(), 'unsubscribed', $default); } + + /** + * @param bool $default + * + * @return boolean + */ + public function isBounced($default = false) + { + return Objects::property($this->_getResultJson(), 'bounced', $default); + } } diff --git a/src/Requests/DeviceRequest.php b/src/Requests/DeviceRequest.php new file mode 100644 index 0000000..6a0166f --- /dev/null +++ b/src/Requests/DeviceRequest.php @@ -0,0 +1,95 @@ + $this->getFid(), + "hardwareId" => $this->getHardwareId(), + "customerFid" => $this->getCustomerFid(), + "displayName" => $this->getDisplayName(), + "deviceType" => $this->getDeviceType(), + "dateCreated" => $this->getDateCreated(), + ]; + } + + /** + * @param mixed $default + * @param bool $trim Trim Value + * + * @return string + */ + public function getFid($default = null, $trim = true) + { + $value = Objects::property($this->_getResultJson(), 'fid', $default); + return $trim ? Strings::ntrim($value) : $value; + } + + /** + * @param mixed $default + * @param bool $trim Trim Value + * + * @return string + */ + public function getHardwareId($default = null, $trim = true) + { + $value = Objects::property($this->_getResultJson(), 'hardwareId', $default); + return $trim ? Strings::ntrim($value) : $value; + } + + /** + * @param mixed $default + * @param bool $trim Trim Value + * + * @return string + */ + public function getCustomerFid($default = null, $trim = true) + { + $value = Objects::property($this->_getResultJson(), 'customerFid', $default); + return $trim ? Strings::ntrim($value) : $value; + } + + /** + * @param mixed $default + * @param bool $trim Trim Value + * + * @return string + */ + public function getDisplayName($default = null, $trim = true) + { + $value = Objects::property($this->_getResultJson(), 'displayName', $default); + return $trim ? Strings::ntrim($value) : $value; + } + + /** + * @param mixed $default + * @param bool $trim Trim Value + * + * @return string + */ + public function getDeviceType($default = null, $trim = true) + { + $value = Objects::property($this->_getResultJson(), 'deviceType', $default); + return $trim ? Strings::ntrim($value) : $value; + } + + /** + * @param mixed $default + * + * @return integer + */ + public function getDateCreated($default = null) + { + return Objects::property($this->_getResultJson(), 'dateCreated', $default); + } +} diff --git a/src/Requests/DevicesRequest.php b/src/Requests/DevicesRequest.php new file mode 100644 index 0000000..3e58571 --- /dev/null +++ b/src/Requests/DevicesRequest.php @@ -0,0 +1,46 @@ + $this->getDevices(), + ]; + } + + /** + * @param mixed $default + * + * @return DeviceRequest[] + */ + public function getDevices($default = []) + { + return Objects::property($this->_getResultJson(), 'devices', $default); + } + + protected function _prepareResult($result) + { + $return = parent::_prepareResult($result); + + if(!empty($return->devices)) + { + foreach($return->devices as $itmKey => $itm) + { + $return->devices[$itmKey] = (new DeviceRequest()) + ->hydrate($itm); + } + } + + return $return; + } +} diff --git a/swagger.yaml b/swagger.yaml index ce0d319..0257e20 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -5112,6 +5112,66 @@ paths: description: Error schema: $ref: '#/definitions/Envelope' + + '/device/devices/{hardwareId}': + get: + summary: Get devices by hardware ID + tags: + - Devices + security: + - OAuth: + - device + - accessToken: [ ] + parameters: + - $ref: '#/parameters/hardwareId' + responses: + 200: + schema: + allOf: + - $ref: '#/definitions/Envelope' + - properties: + data: + $ref: '#/definitions/DevicesResponse' + description: List of devices with matching hardware ID + default: + description: Error + schema: + $ref: '#/definitions/Envelope' + + '/device/statuses/{deviceFid}': + get: + summary: List contact status + tags: + - Devices + security: + - OAuth: + - device + - accessToken: [ ] + parameters: + - $ref: '#/parameters/deviceFid' + - name: brandFid + in: query + type: string + description: Brand FID + required: false + - name: groupFid + in: query + type: string + description: Group FID + required: false + responses: + 200: + schema: + allOf: + - $ref: '#/definitions/Envelope' + - properties: + data: + $ref: '#/definitions/ContactStatusesResponse' + description: Contact statuses + default: + description: Error + schema: + $ref: '#/definitions/Envelope' '/entities/{entityFid}/config/{sectionName}': delete: summary: Remove a config section, or property from an entity @@ -9379,6 +9439,12 @@ parameters: type: string required: true description: Hardware ID + deviceFid: + name: deviceFid + in: path + type: string + required: true + description: Device FID phoneNumber: name: phoneNumber in: path @@ -15241,10 +15307,18 @@ definitions: ContactStatusResponse: description: Contact Status Response properties: + companyFid: + type: string + contactFid: + type: string groupFid: type: string + groupName: + type: string unsubscribed: type: boolean + bounced: + type: boolean ContactStatusesResponse: description: Contact Statuses Response @@ -15253,3 +15327,29 @@ definitions: type: array items: $ref: '#/definitions/ContactStatusResponse' + + DeviceResponse: + description: Device Response + properties: + fid: + type: string + hardwareId: + type: string + customerFid: + type: string + displayName: + type: string + deviceType: + type: string + dateCreated: + type: integer + format: int64 + + DevicesResponse: + description: Devices Response + properties: + devices: + type: array + items: + $ref: '#/definitions/DeviceResponse' +