Skip to content

Commit 2025de1

Browse files
committed
!chore: removes deprecated functions
1 parent 93b7f7a commit 2025de1

2 files changed

Lines changed: 1 addition & 32 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- Removes unused `Error` model
1010
- Corrects the HTTP verb for updating a brand from `GET` to `PATCH`
1111
- Removes the deprecated `create_list` tracker endpoint function as it is no longer available via API
12+
- Removes deprecated `user.all_api_keys` and `user.api_keys`, use `api_key.all` and `api_key.retrieve_api_keys_for_user` respectively
1213

1314
## v6.4.1 (2024-08-09)
1415

lib/easypost/services/user.rb

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -39,38 +39,6 @@ def delete(id)
3939
true
4040
end
4141

42-
# Retrieve a list of all ApiKey objects.
43-
def all_api_keys
44-
warn '[DEPRECATION] `all_api_keys` is deprecated. Please use `all` in the `api_key` service instead.'
45-
response = @client.make_request(:get, 'api_keys')
46-
47-
EasyPost::InternalUtilities::Json.convert_json_to_object(response, EasyPost::Models::ApiKey)
48-
end
49-
50-
# Retrieve a list of ApiKey objects (works for the authenticated user or a child user).
51-
def api_keys(id)
52-
warn '[DEPRECATION] `api_keys` is deprecated.
53-
Please use `retrieve_api_keys_for_user` in the `api_key` service instead.'
54-
55-
api_keys = all_api_keys
56-
57-
if api_keys.id == id
58-
# This function was called on the authenticated user
59-
my_api_keys = api_keys.keys
60-
else
61-
# This function was called on a child user (authenticated as parent, only return this child user's details).
62-
my_api_keys = []
63-
api_keys.children.each do |child|
64-
if child.id == id
65-
my_api_keys = child.keys
66-
break
67-
end
68-
end
69-
end
70-
71-
my_api_keys
72-
end
73-
7442
# Update the Brand of a User.
7543
def update_brand(id, params = {})
7644
wrapped_params = { brand: params }

0 commit comments

Comments
 (0)