Skip to content

Commit

Permalink
- Remove cancel claim function
Browse files Browse the repository at this point in the history
  • Loading branch information
nwithan8 committed Jul 19, 2024
1 parent 68619b4 commit a659738
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 738 deletions.
8 changes: 6 additions & 2 deletions easypost/services/base_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def _create_resource(self, class_name: str, beta: bool = False, **params) -> Any

return convert_to_easypost_object(response=response)

def _all_resources(self, class_name: str, filters: Optional[Dict[str, Any]] = None, beta: bool = False, **params) -> Any:
def _all_resources(
self, class_name: str, filters: Optional[Dict[str, Any]] = None, beta: bool = False, **params
) -> Any:
"""Retrieve a list of EasyPostObjects from the EasyPost API."""
url = self._class_url(class_name)
response = Requestor(self._client).request(method=RequestMethod.GET, url=url, params=params, beta=beta)
Expand All @@ -69,7 +71,9 @@ def _retrieve_resource(self, class_name: str, id: str, beta: bool = False) -> An

return convert_to_easypost_object(response=response)

def _update_resource(self, class_name: str, id: str, method: RequestMethod = RequestMethod.PATCH, beta: bool = False, **params) -> Any:
def _update_resource(
self, class_name: str, id: str, method: RequestMethod = RequestMethod.PATCH, beta: bool = False, **params
) -> Any:
"""Update an EasyPost object via the EasyPost API."""
url = self._instance_url(class_name, id)
wrapped_params = {self._snakecase_name(class_name): params}
Expand Down
12 changes: 0 additions & 12 deletions easypost/services/claim_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,3 @@ def get_next_page(
params.update(optional_params)

return self.all(**params)

def cancel(self, id: str) -> Claim:
"""Cancel a Claim."""
url = f"/claims/{id}/cancel"

response = Requestor(self._client).request(
method=RequestMethod.POST,
url=url,
beta=True,
)

return convert_to_easypost_object(response=response)
Loading

0 comments on commit a659738

Please sign in to comment.