Class: WorkOS::PlatformTeams
- Inherits:
-
Object
- Object
- WorkOS::PlatformTeams
- Defined in:
- lib/workos/platform_teams.rb
Instance Method Summary collapse
-
#create_team(admin_email:, name:, request_options: {}) ⇒ WorkOS::Team
Create a team.
-
#get_team(team_id:, request_options: {}) ⇒ WorkOS::Team
Get a team.
-
#initialize(client) ⇒ PlatformTeams
constructor
A new instance of PlatformTeams.
Constructor Details
#initialize(client) ⇒ PlatformTeams
Returns a new instance of PlatformTeams.
9 10 11 |
# File 'lib/workos/platform_teams.rb', line 9 def initialize(client) @client = client end |
Instance Method Details
#create_team(admin_email:, name:, request_options: {}) ⇒ WorkOS::Team
Create a team
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/workos/platform_teams.rb', line 18 def create_team( admin_email:, name:, request_options: {} ) body = { "admin_email" => admin_email, "name" => name } response = @client.request( method: :post, path: "/platform/teams", auth: true, body: body, request_options: ) result = WorkOS::Team.new(response.body) result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |
#get_team(team_id:, request_options: {}) ⇒ WorkOS::Team
Get a team
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/workos/platform_teams.rb', line 43 def get_team( team_id:, request_options: {} ) response = @client.request( method: :get, path: "/platform/teams/#{WorkOS::Util.encode_path(team_id)}", auth: true, request_options: ) result = WorkOS::Team.new(response.body) result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |