Skip to content

Commit

Permalink
Support GET /v1/%{team_name}/members/%{identifier} API
Browse files Browse the repository at this point in the history
  • Loading branch information
ppworks committed Oct 3, 2023
1 parent f724561 commit 44b5b9b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ client.stats
client.members
#=> GET /v1/teams/bar/members

client.member('me')
#=> GET /v1/teams/bar/members/me

find_by_screen_name = 'alice'
client.member(find_by_screen_name)
#=> GET /v1/teams/bar/members/alice

find_by_email_address = '[email protected]'
client.member(find_by_email_address)
#=> GET /v1/teams/bar/members/[email protected]

delete_by_screen_name = 'alice'
client.delete_member(delete_by_screen_name)
#=> DELETE /v1/teams/bar/members/alice
Expand Down
4 changes: 4 additions & 0 deletions lib/esa/api_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ def members(params = nil, headers = nil)
send_get("/v1/teams/#{current_team!}/members", params, headers)
end

def member(identifier, params = nil, headers = nil)
send_get("/v1/teams/#{current_team!}/members/#{identifier}", params, headers)
end

def delete_member(screen_name, params = nil, headers = nil)
send_delete("/v1/teams/#{current_team!}/members/#{screen_name}", params, headers)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/esa/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Esa
VERSION = '2.0.0'
VERSION = '2.1.0'
end

0 comments on commit 44b5b9b

Please sign in to comment.