Skip to content

feat: add multi-status ticket lookup and site meta removal#24

Open
L0RD-ZER0 wants to merge 2 commits into
mainfrom
feat/ticket-multi-status-and-site-meta-remove
Open

feat: add multi-status ticket lookup and site meta removal#24
L0RD-ZER0 wants to merge 2 commits into
mainfrom
feat/ticket-multi-status-and-site-meta-remove

Conversation

@L0RD-ZER0

Copy link
Copy Markdown
Contributor

This pull request updates the atomic_sdk API client with several improvements to the response tickets and sites modules. The main changes include switching certain ticket retrieval endpoints from GET to POST requests, introducing a new method for batch ticket status retrieval, and adding the ability to remove site metadata.

Response Ticket API improvements:

  • Changed get_summary and get_full methods in response_tickets.py to use POST requests with the ticket ID in the request body instead of GET requests with the ID in the URL. [1] [2]
  • Added a new get_multi_status method to retrieve the status of multiple response tickets in a single POST request.

Site Metadata management:

  • Added a remove_meta method to sites.py for removing a single metadata key from a site by site ID or domain.

- Add ResponseTicketsClient.get_multi_status() to fetch the status of
  multiple response tickets in a single request
- Switch ticket summary/full endpoints from GET with path params to
  POST with form data, matching the API contract
- Add SitesClient.remove_meta() to remove a single metadata key for a site
Copilot AI review requested due to automatic review settings July 17, 2026 07:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread atomic_sdk/api/sites.py Outdated

_, identifier = self._get_service_and_identifier(site_id, domain)
endpoint = f"/site-meta/{identifier}/{key}/remove"
return self._post(endpoint)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove_meta is the only "remove" in the SDK that uses POST — client.remove_meta and remove_alias both use GET. The site-meta endpoint's POST body marks value as required (its documented 400 includes "missing value"), so a POST here with no value risks a 400. The GET variant of /site-meta/{site}/{key}/{action} needs no body and supports the remove action, so use GET to match the sibling methods:

Suggested change
return self._post(endpoint)
return self._get(endpoint)

@mrrobot47
mrrobot47 requested a review from Copilot July 17, 2026 08:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment on lines +41 to +48
"""
Gets the status of multiple response tickets in a single request.

Args:
ticket_ids: A list of response ticket IDs.
Returns:
A dictionary containing the status of multiple tickets.
"""

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in caa781f — added the blank line before Returns: and indented the description to match the other docstrings.

Comment thread atomic_sdk/api/response_tickets.py Outdated
Comment on lines +49 to +51
endpoint = f"/response-ticket/multi-status"

return self._post(endpoint, data=[("response-tickets[]", _) for _ in ticket_ids]) No newline at end of file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in caa781f — dropped the needless f-string prefixes and switched the payload to data={"response-tickets[]": ticket_ids}. requests form-encodes a list value as repeated keys, so the wire format is unchanged while matching the dict payload shape used elsewhere in this module.

Comment thread atomic_sdk/api/sites.py
endpoint = f"/site-meta/{identifier}/{key}/update"
return self._post(endpoint, data={"value": value})

def remove_meta(self, key: str, site_id: Optional[int] = None, domain: Optional[str] = None) -> dict:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this as dict intentionally — the immediate siblings update_meta and remove_alias in this file also return plain dict, so changing only remove_meta would reduce local consistency. A file-wide annotation cleanup would be better done separately.

- Use GET for site remove_meta to match other remove endpoints
- Fix get_multi_status docstring formatting
- Use dict payload and drop needless f-strings in response tickets
Copilot AI review requested due to automatic review settings July 17, 2026 09:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Arittra-Bag
Arittra-Bag self-requested a review July 17, 2026 11:19

@Arittra-Bag Arittra-Bag left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the latest diff along with the existing inline feedback. The response-ticket methods and site metadata removal now match the WP Cloud API contract. I also verified the request shapes with focused smoke tests. No blocking issues from my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants