Class: SlackWebApi::AdminAppsController

Inherits:
BaseController show all
Defined in:
lib/slack_web_api/controllers/admin_apps_controller.rb

Overview

AdminAppsController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

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_apps_approve(token, app_id: nil, request_id: nil, team_id: nil) ⇒ ApiResponse

Approve an app for installation on a workspace. scope: admin.apps:write approve.

Parameters:

  • token (String)

    Required parameter: Authentication token. Requires

  • app_id (String) (defaults to: nil)

    Optional parameter: The id of the app to approve.

  • request_id (String) (defaults to: nil)

    Optional parameter: The id of the request to

  • team_id (String) (defaults to: nil)

    Optional parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/slack_web_api/controllers/admin_apps_controller.rb', line 17

def admin_apps_approve(token,
                       app_id: nil,
                       request_id: nil,
                       team_id: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/admin.apps.approve',
                                 Server::DEFAULT)
               .header_param(new_parameter(token, key: 'token')
                              .is_required(true))
               .form_param(new_parameter(app_id, key: 'app_id'))
               .form_param(new_parameter(request_id, key: 'request_id'))
               .form_param(new_parameter(team_id, key: 'team_id'))
               .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_apps_restrict(token, app_id: nil, request_id: nil, team_id: nil) ⇒ ApiResponse

Restrict an app for installation on a workspace. scope: admin.apps:write restrict. restrict.

Parameters:

  • token (String)

    Required parameter: Authentication token. Requires

  • app_id (String) (defaults to: nil)

    Optional parameter: The id of the app to

  • request_id (String) (defaults to: nil)

    Optional parameter: The id of the request to

  • team_id (String) (defaults to: nil)

    Optional parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/slack_web_api/controllers/admin_apps_controller.rb', line 52

def admin_apps_restrict(token,
                        app_id: nil,
                        request_id: nil,
                        team_id: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/admin.apps.restrict',
                                 Server::DEFAULT)
               .header_param(new_parameter(token, key: 'token')
                              .is_required(true))
               .form_param(new_parameter(app_id, key: 'app_id'))
               .form_param(new_parameter(request_id, key: 'request_id'))
               .form_param(new_parameter(team_id, key: 'team_id'))
               .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