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/preview
When 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/preview
This 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/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. -
#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. -
#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: nil) ⇒ 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. -
#set_rich_menu_image_with_http_info(rich_menu_id:, body: nil) ⇒ 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.
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.
82 83 84 85 86 87 88 89 90 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 82 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.
126 127 128 129 130 131 132 133 134 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 126 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.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 100 def ( # steep:ignore MethodBodyTypeMismatch message_id: ) path = "/v2/bot/message/{messageId}/content/preview" .gsub(/{messageId}/, .to_s) 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.
175 176 177 178 179 180 181 182 183 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 175 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.
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 144 def ( # steep:ignore MethodBodyTypeMismatch message_id: ) path = "/v2/bot/message/{messageId}/content/transcoding" .gsub(/{messageId}/, .to_s) 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) # steep:ignore InsufficientKeywordArguments [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 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 56 def ( # steep:ignore MethodBodyTypeMismatch message_id: ) path = "/v2/bot/message/{messageId}/content" .gsub(/{messageId}/, .to_s) 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.
219 220 221 222 223 224 225 226 227 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 219 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.
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 193 def ( # steep:ignore MethodBodyTypeMismatch rich_menu_id: ) path = "/v2/bot/richmenu/{richMenuId}/content" .gsub(/{richMenuId}/, .to_s) 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: nil) ⇒ 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.
267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 267 def ( rich_menu_id:, body: nil ) response_body, _status_code, _headers = ( rich_menu_id: , body: body ) response_body end |
#set_rich_menu_image_with_http_info(rich_menu_id:, body: nil) ⇒ 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.
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb', line 238 def ( # steep:ignore MethodBodyTypeMismatch rich_menu_id:, body: nil ) path = "/v2/bot/richmenu/{richMenuId}/content" .gsub(/{richMenuId}/, .to_s) 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 |