Class: SlackWebApi::AdminTeamsController
- Inherits:
-
BaseController
- Object
- BaseController
- SlackWebApi::AdminTeamsController
- Defined in:
- lib/slack_web_api/controllers/admin_teams_controller.rb
Overview
AdminTeamsController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#admin_teams_create(token, team_domain, team_name, team_description: nil, team_discoverability: nil) ⇒ ApiResponse
Create an Enterprise team.
-
#admin_teams_list(token, limit: nil, cursor: nil) ⇒ ApiResponse
List all teams on an Enterprise organization scope:
admin.teams:readreturn.
Methods inherited from BaseController
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from SlackWebApi::BaseController
Instance Method Details
#admin_teams_create(token, team_domain, team_name, team_description: nil, team_discoverability: nil) ⇒ ApiResponse
Create an Enterprise team. scope: admin.teams:write slacksoftballteam). Slack Softball Team). team. team. A team’s discoverability can be open, closed, invite_only, or unlisted.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/slack_web_api/controllers/admin_teams_controller.rb', line 22 def admin_teams_create(token, team_domain, team_name, team_description: nil, team_discoverability: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/admin.teams.create', Server::DEFAULT) .header_param(new_parameter(token, key: 'token') .is_required(true)) .form_param(new_parameter(team_domain, key: 'team_domain') .is_required(true)) .form_param(new_parameter(team_name, key: 'team_name') .is_required(true)) .form_param(new_parameter(team_description, key: 'team_description')) .form_param(new_parameter(team_discoverability, key: 'team_discoverability')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(DefaultSuccessTemplate.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response', DefaultErrorTemplateException)) .execute end |
#admin_teams_list(token, limit: nil, cursor: nil) ⇒ ApiResponse
List all teams on an Enterprise organization scope: admin.teams:read return. Must be between 1 - 100 both inclusive. returned by the previous call to list items in the next page.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/slack_web_api/controllers/admin_teams_controller.rb', line 60 def admin_teams_list(token, limit: nil, cursor: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/admin.teams.list', Server::DEFAULT) .header_param(new_parameter(token, key: 'token') .is_required(true)) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'Content-Type')) .query_param(new_parameter(limit, key: 'limit')) .query_param(new_parameter(cursor, key: 'cursor')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('slackAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(DefaultSuccessTemplate.method(:from_hash)) .is_api_response(true) .local_error('default', 'Typical error response', DefaultErrorTemplateException)) .execute end |