Add IM\Counters service for im.counters.get (#433)#461
Merged
Conversation
# Conflicts: # CHANGELOG.md # Makefile # phpunit.xml.dist # src/Services/IM/IMServiceBuilder.php # tests/Unit/Services/IM/IMServiceBuilderTest.php
…ot fields in REST payloads - Updated `CountersItemResult` to include live-verified fields from `im.counters.get`. - Migrated `CountersItemResult` from `AbstractItem` to `AbstractAnnotatedItem` for improved type annotations and runtime casting. - Enhanced payload generator to handle direct root fields in the `Returned Data` REST docs table. - Added integration and unit tests for updated field mappings and generator logic. - Updated `CHANGELOG.md` to reflect the changes. Signed-off-by: mesilov <mesilov.maxim@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for the Bitrix24 REST API method
im.counters.get, which retrieves unread message and notification counters for the currently authenticated user.Changes
New Service Structure:
IM\Counters\Service\Counters– Service class withget()methodIM\Counters\Result\CountersResult– Result wrapper for the API responseIM\Counters\Result\CountersItemResult– Item class with typed properties for counter fields (TYPE,MESSAGE,NOTIFY,CHAT,LINES)Integration:
counters()method toIMServiceBuilderfor service accessIMServiceBuildertest to verify service cachingTesting:
Configuration:
phpunit.xml.distUsage Example
Test Plan
All automated tests pass:
https://claude.ai/code/session_017PUmAzXXyQAH4YfWJwDzzo