Skip to content

Commit

Permalink
run: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nanato12 committed Nov 28, 2023
1 parent b25d3d4 commit 064d96c
Show file tree
Hide file tree
Showing 283 changed files with 3,418 additions and 2,928 deletions.
228 changes: 160 additions & 68 deletions openapi/src/channel_access_token/apis/channel_access_token_api.rs

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions openapi/src/channel_access_token/apis/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@
* This document describes Channel Access Token API.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/



#[derive(Debug, Clone)]
pub struct Configuration {
pub base_path: String,
Expand All @@ -46,7 +44,6 @@ pub struct ApiKey {
pub key: String,
}


impl Configuration {
pub fn new() -> Configuration {
Configuration::default()
Expand All @@ -63,7 +60,6 @@ impl Default for Configuration {
oauth_access_token: None,
bearer_access_token: None,
api_key: None,

}
}
}
16 changes: 9 additions & 7 deletions openapi/src/channel_access_token/apis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub enum Error<T> {
ResponseError(ResponseContent<T>),
}

impl <T> fmt::Display for Error<T> {
impl<T> fmt::Display for Error<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let (module, e) = match self {
Error::Reqwest(e) => ("reqwest", e.to_string()),
Expand All @@ -44,7 +44,7 @@ impl <T> fmt::Display for Error<T> {
}
}

impl <T: fmt::Debug> error::Error for Error<T> {
impl<T: fmt::Debug> error::Error for Error<T> {
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
Some(match self {
Error::Reqwest(e) => e,
Expand All @@ -55,19 +55,19 @@ impl <T: fmt::Debug> error::Error for Error<T> {
}
}

impl <T> From<reqwest::Error> for Error<T> {
impl<T> From<reqwest::Error> for Error<T> {
fn from(e: reqwest::Error) -> Self {
Error::Reqwest(e)
}
}

impl <T> From<serde_json::Error> for Error<T> {
impl<T> From<serde_json::Error> for Error<T> {
fn from(e: serde_json::Error) -> Self {
Error::Serde(e)
}
}

impl <T> From<std::io::Error> for Error<T> {
impl<T> From<std::io::Error> for Error<T> {
fn from(e: std::io::Error) -> Self {
Error::Io(e)
}
Expand All @@ -94,8 +94,10 @@ pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String
value,
));
}
},
serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())),
}
serde_json::Value::String(s) => {
params.push((format!("{}[{}]", prefix, key), s.clone()))
}
_ => params.push((format!("{}[{}]", prefix, key), value.to_string())),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
* This document describes Channel Access Token API.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/

/// ChannelAccessTokenKeyIdsResponse : Channel access token key IDs


#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ChannelAccessTokenKeyIdsResponse {
/// Array of channel access token key IDs.
Expand All @@ -38,10 +36,6 @@ pub struct ChannelAccessTokenKeyIdsResponse {
impl ChannelAccessTokenKeyIdsResponse {
/// Channel access token key IDs
pub fn new(kids: Vec<String>) -> ChannelAccessTokenKeyIdsResponse {
ChannelAccessTokenKeyIdsResponse {
kids,
}
ChannelAccessTokenKeyIdsResponse { kids }
}
}


6 changes: 1 addition & 5 deletions openapi/src/channel_access_token/models/error_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
* This document describes Channel Access Token API.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/

/// ErrorResponse : Error response of the Channel access token


#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ErrorResponse {
/// Error summary
Expand All @@ -47,5 +45,3 @@ impl ErrorResponse {
}
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@
* This document describes Channel Access Token API.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/

/// IssueChannelAccessTokenResponse : Issued channel access token


#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct IssueChannelAccessTokenResponse {
/// Channel access token.
/// Channel access token.
#[serde(rename = "access_token")]
pub access_token: String,
/// Amount of time in seconds from issue to expiration of the channel access token
Expand All @@ -46,7 +44,12 @@ pub struct IssueChannelAccessTokenResponse {

impl IssueChannelAccessTokenResponse {
/// Issued channel access token
pub fn new(access_token: String, expires_in: i32, token_type: String, key_id: String) -> IssueChannelAccessTokenResponse {
pub fn new(
access_token: String,
expires_in: i32,
token_type: String,
key_id: String,
) -> IssueChannelAccessTokenResponse {
IssueChannelAccessTokenResponse {
access_token,
expires_in,
Expand All @@ -55,5 +58,3 @@ impl IssueChannelAccessTokenResponse {
}
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@
* This document describes Channel Access Token API.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/

/// IssueShortLivedChannelAccessTokenResponse : Issued short-lived channel access token


#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct IssueShortLivedChannelAccessTokenResponse {
/// A short-lived channel access token. Valid for 30 days. Note: Channel access tokens cannot be refreshed.
/// A short-lived channel access token. Valid for 30 days. Note: Channel access tokens cannot be refreshed.
#[serde(rename = "access_token")]
pub access_token: String,
/// Time until channel access token expires in seconds from time the token is issued.
Expand All @@ -43,13 +41,15 @@ pub struct IssueShortLivedChannelAccessTokenResponse {

impl IssueShortLivedChannelAccessTokenResponse {
/// Issued short-lived channel access token
pub fn new(access_token: String, expires_in: i32, token_type: String) -> IssueShortLivedChannelAccessTokenResponse {
pub fn new(
access_token: String,
expires_in: i32,
token_type: String,
) -> IssueShortLivedChannelAccessTokenResponse {
IssueShortLivedChannelAccessTokenResponse {
access_token,
expires_in,
token_type,
}
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@
* This document describes Channel Access Token API.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/

/// IssueStatelessChannelAccessTokenResponse : Issued stateless channel access token


#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct IssueStatelessChannelAccessTokenResponse {
/// A stateless channel access token. The token is an opaque string which means its format is an implementation detail and the consumer of this token should never try to use the data parsed from the token.
/// A stateless channel access token. The token is an opaque string which means its format is an implementation detail and the consumer of this token should never try to use the data parsed from the token.
#[serde(rename = "access_token")]
pub access_token: String,
/// Duration in seconds after which the issued access token expires
Expand All @@ -43,13 +41,15 @@ pub struct IssueStatelessChannelAccessTokenResponse {

impl IssueStatelessChannelAccessTokenResponse {
/// Issued stateless channel access token
pub fn new(access_token: String, expires_in: i32, token_type: String) -> IssueStatelessChannelAccessTokenResponse {
pub fn new(
access_token: String,
expires_in: i32,
token_type: String,
) -> IssueStatelessChannelAccessTokenResponse {
IssueStatelessChannelAccessTokenResponse {
access_token,
expires_in,
token_type,
}
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
* This document describes Channel Access Token API.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/

/// VerifyChannelAccessTokenResponse : Verification result


#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct VerifyChannelAccessTokenResponse {
/// The channel ID for which the channel access token was issued.
Expand All @@ -51,5 +49,3 @@ impl VerifyChannelAccessTokenResponse {
}
}
}


6 changes: 1 addition & 5 deletions openapi/src/insight/apis/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@
* This document describes LINE Messaging API(Insight).
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/



#[derive(Debug, Clone)]
pub struct Configuration {
pub base_path: String,
Expand All @@ -46,7 +44,6 @@ pub struct ApiKey {
pub key: String,
}


impl Configuration {
pub fn new() -> Configuration {
Configuration::default()
Expand All @@ -63,7 +60,6 @@ impl Default for Configuration {
oauth_access_token: None,
bearer_access_token: None,
api_key: None,

}
}
}
Loading

0 comments on commit 064d96c

Please sign in to comment.