Class: Line::Bot::V2::MessagingApi::ApiBlobClient
- Inherits:
-
Object
- Object
- Line::Bot::V2::MessagingApi::ApiBlobClient
- Defined in:
- lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb
Instance Method Summary collapse
-
#get_message_content(message_id:) ⇒ String?
Download image, video, and audio data sent from users.
-
#get_message_content_preview(message_id:) ⇒ String?
Get a preview image of the image or video This requests to
GET https://api-data.line.me/v2/bot/message/{messageId}/content/previewWhen you want to get HTTP status code or response headers, use #get_message_content_preview_with_http_info instead of this. -
#get_message_content_preview_with_http_info(message_id:) ⇒ Array((String|nil), Integer, Hash{String => String})
Get a preview image of the image or video This requests to
GET https://api-data.line.me/v2/bot/message/{messageId}/content/previewThis returns an array containing response, HTTP status code, and header in order. -
#get_message_content_transcoding_by_message_id(message_id:) ⇒ Line::Bot::V2::MessagingApi::GetMessageContentTranscodingResponse, ...
Verify the preparation status of a video or audio for getting This requests to
GET https://api-data.line.me/v2/bot/message/{messageId}/content/transcodingWhen you want to get HTTP status code or response headers, use #get_message_content_transcoding_by_message_id_with_http_info instead of this. -
#get_message_content_transcoding_by_message_id_with_http_info(message_id:) ⇒ Array(Line::Bot::V2::MessagingApi::GetMessageContentTranscodingResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})
Verify the preparation status of a video or audio for getting This requests to
GET https://api-data.line.me/v2/bot/message/{messageId}/content/transcodingThis returns an array containing response, HTTP status code, and header in order. -
#get_message_content_with_http_info(message_id:) ⇒ Array((String|nil), Integer, Hash{String => String})
Download image, video, and audio data sent from users.
-
#get_rich_menu_image(rich_menu_id:) ⇒ String?
Download rich menu image.
-
#get_rich_menu_image_with_http_info(rich_menu_id:) ⇒ Array((String|nil), Integer, Hash{String => String})
Download rich menu image.
-
#initialize(base_url: nil, channel_access_token:, http_options: {}) ⇒ ApiBlobClient
constructor
Initializes a new ApiBlobClient instance.
-
#set_rich_menu_image(rich_menu_id:, body:) ⇒ String?
Upload rich menu image This requests to
POST https://api-data.line.me/v2/bot/richmenu/{richMenuId}/contentWhen you want to get HTTP status code or response headers, use #set_rich_menu_image_with_http_info instead of this. -
#set_rich_menu_image_with_http_info(rich_menu_id:, body:) ⇒ Array((String|nil), Integer, Hash{String => String})
Upload rich menu image This requests to
POST https://api-data.line.me/v2/bot/richmenu/{richMenuId}/contentThis returns an array containing response, HTTP status code, and header in order.
Constructor Details
#initialize(base_url: nil, channel_access_token:, http_options: {}) ⇒ ApiBlobClient
Initializes a new Line::Bot::V2::MessagingApi::ApiBlobClient instance.
38 39 40 41 42 43 44 45 46 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 38 def initialize(base_url: nil, channel_access_token:, http_options: {}) @http_client = HttpClient.new( base_url: base_url || 'https://api-data.line.me', http_headers: { Authorization: "Bearer #{channel_access_token}" }, http_options: ) end |
Instance Method Details
#get_message_content(message_id:) ⇒ String?
Download image, video, and audio data sent from users. This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content When you want to get HTTP status code or response headers, use #get_message_content_with_http_info instead of this.
83 84 85 86 87 88 89 90 91 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 83 def ( message_id: ) response_body, _status_code, _headers = ( message_id: ) response_body end |
#get_message_content_preview(message_id:) ⇒ String?
Get a preview image of the image or video This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content/preview When you want to get HTTP status code or response headers, use #get_message_content_preview_with_http_info instead of this.
128 129 130 131 132 133 134 135 136 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 128 def ( message_id: ) response_body, _status_code, _headers = ( message_id: ) response_body end |
#get_message_content_preview_with_http_info(message_id:) ⇒ Array((String|nil), Integer, Hash{String => String})
Get a preview image of the image or video This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content/preview This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 101 def ( message_id: ) path = Line::Bot::V2::Utils.build_path("/v2/bot/message/{messageId}/content/preview", { "messageId": }) response = @http_client.get( path: path, ) case response.code.to_i when 200 [response.body, 200, response.each_header.to_h] else [response.body, response.code.to_i, response.each_header.to_h] end end |
#get_message_content_transcoding_by_message_id(message_id:) ⇒ Line::Bot::V2::MessagingApi::GetMessageContentTranscodingResponse, ...
Verify the preparation status of a video or audio for getting This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content/transcoding When you want to get HTTP status code or response headers, use #get_message_content_transcoding_by_message_id_with_http_info instead of this.
178 179 180 181 182 183 184 185 186 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 178 def ( message_id: ) response_body, _status_code, _headers = ( message_id: ) response_body end |
#get_message_content_transcoding_by_message_id_with_http_info(message_id:) ⇒ Array(Line::Bot::V2::MessagingApi::GetMessageContentTranscodingResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})
Verify the preparation status of a video or audio for getting This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content/transcoding This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 146 def ( message_id: ) path = Line::Bot::V2::Utils.build_path("/v2/bot/message/{messageId}/content/transcoding", { "messageId": }) response = @http_client.get( path: path, ) case response.code.to_i when 200 json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body)) json.transform_keys! do |key| Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key end response_body = Line::Bot::V2::MessagingApi::GetMessageContentTranscodingResponse.create(json) [response_body, 200, response.each_header.to_h] else [response.body, response.code.to_i, response.each_header.to_h] end end |
#get_message_content_with_http_info(message_id:) ⇒ Array((String|nil), Integer, Hash{String => String})
Download image, video, and audio data sent from users. This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 56 def ( message_id: ) path = Line::Bot::V2::Utils.build_path("/v2/bot/message/{messageId}/content", { "messageId": }) response = @http_client.get( path: path, ) case response.code.to_i when 200 [response.body, 200, response.each_header.to_h] else [response.body, response.code.to_i, response.each_header.to_h] end end |
#get_rich_menu_image(rich_menu_id:) ⇒ String?
Download rich menu image. This requests to GET https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content When you want to get HTTP status code or response headers, use #get_rich_menu_image_with_http_info instead of this.
223 224 225 226 227 228 229 230 231 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 223 def ( rich_menu_id: ) response_body, _status_code, _headers = ( rich_menu_id: ) response_body end |
#get_rich_menu_image_with_http_info(rich_menu_id:) ⇒ Array((String|nil), Integer, Hash{String => String})
Download rich menu image. This requests to GET https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 196 def ( rich_menu_id: ) path = Line::Bot::V2::Utils.build_path("/v2/bot/richmenu/{richMenuId}/content", { "richMenuId": }) response = @http_client.get( path: path, ) case response.code.to_i when 200 [response.body, 200, response.each_header.to_h] else [response.body, response.code.to_i, response.each_header.to_h] end end |
#set_rich_menu_image(rich_menu_id:, body:) ⇒ String?
Upload rich menu image This requests to POST https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content When you want to get HTTP status code or response headers, use #set_rich_menu_image_with_http_info instead of this.
272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 272 def ( rich_menu_id:, body: ) response_body, _status_code, _headers = ( rich_menu_id: , body: body ) response_body end |
#set_rich_menu_image_with_http_info(rich_menu_id:, body:) ⇒ Array((String|nil), Integer, Hash{String => String})
Upload rich menu image This requests to POST https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 242 def ( rich_menu_id:, body: ) path = Line::Bot::V2::Utils.build_path("/v2/bot/richmenu/{richMenuId}/content", { "richMenuId": }) response = @http_client.post( path: path, body_params: body, ) case response.code.to_i when 200 [response.body, 200, response.each_header.to_h] else [response.body, response.code.to_i, response.each_header.to_h] end end |