Class: SlackWebApi::AdminEmojiController
- Inherits:
-
BaseController
- Object
- BaseController
- SlackWebApi::AdminEmojiController
- Defined in:
- lib/slack_web_api/controllers/admin_emoji_controller.rb
Overview
AdminEmojiController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#admin_emoji_add(token, name, url) ⇒ ApiResponse
Add an emoji.
-
#admin_emoji_add_alias(token, name, alias_for) ⇒ ApiResponse
Add an emoji alias.
-
#admin_emoji_list(token, cursor: nil, limit: nil) ⇒ ApiResponse
List emoji for an Enterprise Grid organization.
-
#admin_emoji_remove(token, name) ⇒ ApiResponse
Remove an emoji across an Enterprise Grid organization scope:
admin.teams:writeremoved. -
#admin_emoji_rename(token, name, new_name) ⇒ ApiResponse
Rename an emoji.
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_emoji_add(token, name, url) ⇒ ApiResponse
Add an emoji. scope: admin.teams:write removed. Colons (:myemoji:) around the value are not required, although they may be included. image for the emoji. Square images under 128KB and with transparent backgrounds work best.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/slack_web_api/controllers/admin_emoji_controller.rb', line 19 def admin_emoji_add(token, name, url) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/admin.emoji.add', Server::DEFAULT) .form_param(new_parameter(token, key: 'token') .is_required(true)) .form_param(new_parameter(name, key: 'name') .is_required(true)) .form_param(new_parameter(url, key: 'url') .is_required(true)) .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_emoji_add_alias(token, name, alias_for) ⇒ ApiResponse
Add an emoji alias. scope: admin.teams:write aliased. Colons (:myemoji:) around the value are not required, although they may be included.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/slack_web_api/controllers/admin_emoji_controller.rb', line 53 def admin_emoji_add_alias(token, name, alias_for) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/admin.emoji.addAlias', Server::DEFAULT) .form_param(new_parameter(token, key: 'token') .is_required(true)) .form_param(new_parameter(name, key: 'name') .is_required(true)) .form_param(new_parameter(alias_for, key: 'alias_for') .is_required(true)) .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_emoji_list(token, cursor: nil, limit: nil) ⇒ ApiResponse
List emoji for an Enterprise Grid organization. scope: admin.teams:read returned by the previous call to list items in the next page return. Must be between 1 - 1000 both inclusive.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/slack_web_api/controllers/admin_emoji_controller.rb', line 87 def admin_emoji_list(token, cursor: nil, limit: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/admin.emoji.list', Server::DEFAULT) .query_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(cursor, key: 'cursor')) .query_param(new_parameter(limit, key: 'limit')) .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_emoji_remove(token, name) ⇒ ApiResponse
Remove an emoji across an Enterprise Grid organization scope: admin.teams:write removed. Colons (:myemoji:) around the value are not required, although they may be included.
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/slack_web_api/controllers/admin_emoji_controller.rb', line 118 def admin_emoji_remove(token, name) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/admin.emoji.remove', Server::DEFAULT) .form_param(new_parameter(token, key: 'token') .is_required(true)) .form_param(new_parameter(name, key: 'name') .is_required(true)) .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_emoji_rename(token, name, new_name) ⇒ ApiResponse
Rename an emoji. scope: admin.teams:write renamed. Colons (:myemoji:) around the value are not required, although they may be included.
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/slack_web_api/controllers/admin_emoji_controller.rb', line 149 def admin_emoji_rename(token, name, new_name) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/admin.emoji.rename', Server::DEFAULT) .form_param(new_parameter(token, key: 'token') .is_required(true)) .form_param(new_parameter(name, key: 'name') .is_required(true)) .form_param(new_parameter(new_name, key: 'new_name') .is_required(true)) .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 |