Skip to content

Commit 39b31bf

Browse files
committed
Update bot.rs
・update doc comment
1 parent 5ab072a commit 39b31bf

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

src/bot.rs

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
//! Bot Client
2+
//! # Example
3+
//! ```
4+
//! extern crate line_bot_sdk_rust as line;
5+
//! use line::bot::LineBot;
6+
//!
7+
//! fn main() {
8+
//! let bot = LineBot::new("<channel secret>", "<channel access token>");
9+
//! }
10+
//! ```
211
312
use crate::client::HttpClient;
413
use crate::events::Events;
@@ -15,6 +24,7 @@ use reqwest::Error;
1524
use serde_derive::Serialize;
1625
use serde_json::{json, Value};
1726

27+
/// LineBot Client
1828
#[derive(Debug)]
1929
pub struct LineBot {
2030
pub channel_secret: String,
@@ -294,10 +304,12 @@ impl LineBot {
294304
)
295305
}
296306

297-
// manage-audience
298-
299-
// TODO: More Request Body
300-
// https://developers.line.biz/ja/reference/messaging-api/#create-upload-audience-group-request-body
307+
/// # Managing Audience
308+
/// TODO: Unimplemented: More Request Body <br>
309+
/// You can create, update, activate, or delete an audience. Specify the audience when sending narrowcast messages [\[detail\]](https://developers.line.biz/en/reference/messaging-api/#manage-audience-group)
310+
/// ```
311+
/// let res: Result<Response, Error> = bot.create_audience_group_for_uploading_user_ids("audienceGroupName");
312+
/// ```
301313
pub fn create_audience_group_for_uploading_user_ids(
302314
&self,
303315
description: &str,
@@ -310,19 +322,20 @@ impl LineBot {
310322
self.http_client.post("/audienceGroup/upload", data)
311323
}
312324

313-
// TODO: More Request Body
314-
// https://developers.line.biz/ja/reference/messaging-api/#create-upload-audience-group-by-file-request-body
325+
/// # Create audience for uploading user IDs (by file)
326+
/// TODO: Unimplemented: File send <br>
327+
/// Creates an audience for uploading user IDs [\[detail\]](https://developers.line.biz/ja/reference/messaging-api/#create-upload-audience-group-by-file-request-body)
315328
pub fn create_audience_group_for_uploading_user_ids_by_file(
316329
&self,
317330
_description: &str,
318331
) -> Result<Response, Error> {
319-
// TODO: Fix HTTPClient post
320-
// File send
321332
self.http_client
322333
.post("/audienceGroup/upload/byFile", json!({}))
323334
}
324335

325-
// TODO: Create Audience Object?
336+
/// # Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON)
337+
/// TODO: Create Audience Object <br>
338+
/// Adds new user IDs or IFAs to an audience for uploading user IDs [\[detail\]](https://developers.line.biz/ja/reference/messaging-api/#update-upload-audience-group)
326339
pub fn update_audience_group_for_uploading_user_ids(
327340
&self,
328341
audience_group_id: i64,
@@ -339,8 +352,9 @@ impl LineBot {
339352
self.http_client.post("/audienceGroup/upload", data)
340353
}
341354

342-
// TODO: More Request Body
343-
// https://developers.line.biz/ja/reference/messaging-api/#update-upload-audience-group-by-file-request-body
355+
/// # Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file)
356+
/// TODO: Unimplemented: File send <br>
357+
/// Adds new user IDs or IFAs to an audience for uploading user IDs [\[detail\]](https://developers.line.biz/ja/reference/messaging-api/#update-upload-audience-group-by-file-request-body)
344358
pub fn update_audience_group_for_uploading_user_ids_by_file(
345359
&self,
346360
_description: &str,

0 commit comments

Comments
 (0)