Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: regenerate #18

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ docs/Oauth2Api.md
docs/Ogp.md
docs/OgpApi.md
docs/OgpMedia.md
docs/OidcTraqUserInfo.md
docs/OidcUserInfo.md
docs/ParentChangedEvent.md
docs/PatchBotRequest.md
docs/PatchChannelRequest.md
Expand Down Expand Up @@ -106,6 +108,7 @@ docs/PutChannelTopicRequest.md
docs/PutMyPasswordRequest.md
docs/PutNotifyCitationRequest.md
docs/PutUserPasswordRequest.md
docs/Session.md
docs/Stamp.md
docs/StampApi.md
docs/StampHistoryEntry.md
Expand Down Expand Up @@ -137,7 +140,6 @@ docs/VersionFlags.md
docs/VisibilityChangedEvent.md
docs/WebRtcAuthenticateResult.md
docs/WebRtcUserState.md
docs/WebRtcUserStateSessionsInner.md
docs/Webhook.md
docs/WebhookApi.md
docs/WebrtcApi.md
Expand Down Expand Up @@ -214,6 +216,8 @@ src/models/o_auth2_scope.rs
src/models/o_auth2_token.rs
src/models/ogp.rs
src/models/ogp_media.rs
src/models/oidc_traq_user_info.rs
src/models/oidc_user_info.rs
src/models/parent_changed_event.rs
src/models/patch_bot_request.rs
src/models/patch_channel_request.rs
Expand Down Expand Up @@ -258,6 +262,7 @@ src/models/put_channel_topic_request.rs
src/models/put_my_password_request.rs
src/models/put_notify_citation_request.rs
src/models/put_user_password_request.rs
src/models/session.rs
src/models/stamp.rs
src/models/stamp_history_entry.rs
src/models/stamp_palette.rs
Expand Down Expand Up @@ -285,5 +290,4 @@ src/models/version_flags.rs
src/models/visibility_changed_event.rs
src/models/web_rtc_authenticate_result.rs
src/models/web_rtc_user_state.rs
src/models/web_rtc_user_state_sessions_inner.rs
src/models/webhook.rs
28 changes: 28 additions & 0 deletions docs/MeApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Method | HTTP request | Description
[**get_my_unread_channels**](MeApi.md#get_my_unread_channels) | **GET** /users/me/unread | 未読チャンネルを取得
[**get_my_user_tags**](MeApi.md#get_my_user_tags) | **GET** /users/me/tags | 自分のタグリストを取得
[**get_my_view_states**](MeApi.md#get_my_view_states) | **GET** /users/me/view-states | 自身のチャンネル閲覧状態一覧を取得
[**get_oidc_user_info**](MeApi.md#get_oidc_user_info) | **GET** /users/me/oidc | 自分のユーザー詳細を取得 (OIDC UserInfo)
[**get_user_settings**](MeApi.md#get_user_settings) | **GET** /users/me/settings | ユーザー設定を取得
[**link_external_account**](MeApi.md#link_external_account) | **POST** /users/me/ex-accounts/link | 外部ログインアカウントを紐付ける
[**read_channel**](MeApi.md#read_channel) | **DELETE** /users/me/unread/{channelId} | チャンネルを既読にする
Expand Down Expand Up @@ -605,6 +606,33 @@ This endpoint does not need any parameter.
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## get_oidc_user_info

> crate::models::OidcUserInfo get_oidc_user_info()
自分のユーザー詳細を取得 (OIDC UserInfo)

OIDCトークンを用いてユーザー詳細を取得します。 OIDC UserInfo Endpointです。

### Parameters

This endpoint does not need any parameter.

### Return type

[**crate::models::OidcUserInfo**](OIDCUserInfo.md)

### Authorization

[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## get_user_settings

> crate::models::UserSettings get_user_settings()
Expand Down
21 changes: 21 additions & 0 deletions docs/OidcTraqUserInfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# OidcTraqUserInfo

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bio** | **String** | 自己紹介(biography) |
**groups** | [**Vec<uuid::Uuid>**](uuid::Uuid.md) | 所属グループのUUIDの配列 |
**tags** | [**Vec<crate::models::UserTag>**](UserTag.md) | タグリスト |
**last_online** | Option<**String**> | 最終オンライン日時 |
**twitter_id** | **String** | Twitter ID |
**display_name** | **String** | ユーザー表示名 |
**icon_file_id** | [**uuid::Uuid**](uuid::Uuid.md) | アイコンファイルUUID |
**bot** | **bool** | BOTかどうか |
**state** | [**crate::models::UserAccountState**](UserAccountState.md) | |
**permissions** | [**Vec<crate::models::UserPermission>**](UserPermission.md) | 所有している権限の配列 |
**home_channel** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | ホームチャンネル |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


16 changes: 16 additions & 0 deletions docs/OidcUserInfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# OidcUserInfo

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**sub** | [**uuid::Uuid**](uuid::Uuid.md) | ユーザーUUID |
**name** | **String** | ユーザー名 |
**preferred_username** | **String** | ユーザー名 |
**picture** | **String** | アイコン画像URL |
**updated_at** | Option<**i64**> | 更新日時 | [optional]
**traq** | Option<[**crate::models::OidcTraqUserInfo**](OIDCTraqUserInfo.md)> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


5 changes: 4 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ Class | Method | HTTP request | Description
*MeApi* | [**get_my_unread_channels**](MeApi.md#get_my_unread_channels) | **GET** /users/me/unread | 未読チャンネルを取得
*MeApi* | [**get_my_user_tags**](MeApi.md#get_my_user_tags) | **GET** /users/me/tags | 自分のタグリストを取得
*MeApi* | [**get_my_view_states**](MeApi.md#get_my_view_states) | **GET** /users/me/view-states | 自身のチャンネル閲覧状態一覧を取得
*MeApi* | [**get_oidc_user_info**](MeApi.md#get_oidc_user_info) | **GET** /users/me/oidc | 自分のユーザー詳細を取得 (OIDC UserInfo)
*MeApi* | [**get_user_settings**](MeApi.md#get_user_settings) | **GET** /users/me/settings | ユーザー設定を取得
*MeApi* | [**link_external_account**](MeApi.md#link_external_account) | **POST** /users/me/ex-accounts/link | 外部ログインアカウントを紐付ける
*MeApi* | [**read_channel**](MeApi.md#read_channel) | **DELETE** /users/me/unread/{channelId} | チャンネルを既読にする
Expand Down Expand Up @@ -278,6 +279,8 @@ Class | Method | HTTP request | Description
- [OAuth2Token](OAuth2Token.md)
- [Ogp](Ogp.md)
- [OgpMedia](OgpMedia.md)
- [OidcTraqUserInfo](OidcTraqUserInfo.md)
- [OidcUserInfo](OidcUserInfo.md)
- [ParentChangedEvent](ParentChangedEvent.md)
- [PatchBotRequest](PatchBotRequest.md)
- [PatchChannelRequest](PatchChannelRequest.md)
Expand Down Expand Up @@ -322,6 +325,7 @@ Class | Method | HTTP request | Description
- [PutMyPasswordRequest](PutMyPasswordRequest.md)
- [PutNotifyCitationRequest](PutNotifyCitationRequest.md)
- [PutUserPasswordRequest](PutUserPasswordRequest.md)
- [Session](Session.md)
- [Stamp](Stamp.md)
- [StampHistoryEntry](StampHistoryEntry.md)
- [StampPalette](StampPalette.md)
Expand Down Expand Up @@ -349,7 +353,6 @@ Class | Method | HTTP request | Description
- [VisibilityChangedEvent](VisibilityChangedEvent.md)
- [WebRtcAuthenticateResult](WebRtcAuthenticateResult.md)
- [WebRtcUserState](WebRtcUserState.md)
- [WebRtcUserStateSessionsInner](WebRtcUserStateSessionsInner.md)
- [Webhook](Webhook.md)


Expand Down
12 changes: 12 additions & 0 deletions docs/Session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Session

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**state** | **String** | 状態 |
**session_id** | **String** | セッションID |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


2 changes: 1 addition & 1 deletion docs/WebRtcUserState.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**user_id** | [**uuid::Uuid**](uuid::Uuid.md) | ユーザーUUID |
**channel_id** | [**uuid::Uuid**](uuid::Uuid.md) | チャンネルUUID |
**sessions** | [**Vec<crate::models::WebRtcUserStateSessionsInner>**](WebRTCUserState_sessions_inner.md) | セッションの配列 |
**sessions** | [**Vec<crate::models::Session>**](Session.md) | セッションの配列 |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
50 changes: 50 additions & 0 deletions src/apis/me_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ pub enum GetMyViewStatesError {
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`get_oidc_user_info`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetOidcUserInfoError {
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`get_user_settings`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
Expand Down Expand Up @@ -1144,6 +1151,49 @@ pub async fn get_my_view_states(
}
}

/// OIDCトークンを用いてユーザー詳細を取得します。 OIDC UserInfo Endpointです。
pub async fn get_oidc_user_info(
configuration: &configuration::Configuration,
) -> Result<crate::models::OidcUserInfo, Error<GetOidcUserInfoError>> {
let local_var_configuration = configuration;

let local_var_client = &local_var_configuration.client;

let local_var_uri_str = format!("{}/users/me/oidc", local_var_configuration.base_path);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());

if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};

let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;

let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;

if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<GetOidcUserInfoError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}

/// ユーザー設定を取得します。
pub async fn get_user_settings(
configuration: &configuration::Configuration,
Expand Down
8 changes: 6 additions & 2 deletions src/models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ pub mod ogp;
pub use self::ogp::Ogp;
pub mod ogp_media;
pub use self::ogp_media::OgpMedia;
pub mod oidc_traq_user_info;
pub use self::oidc_traq_user_info::OidcTraqUserInfo;
pub mod oidc_user_info;
pub use self::oidc_user_info::OidcUserInfo;
pub mod parent_changed_event;
pub use self::parent_changed_event::ParentChangedEvent;
pub mod patch_bot_request;
Expand Down Expand Up @@ -184,6 +188,8 @@ pub mod put_notify_citation_request;
pub use self::put_notify_citation_request::PutNotifyCitationRequest;
pub mod put_user_password_request;
pub use self::put_user_password_request::PutUserPasswordRequest;
pub mod session;
pub use self::session::Session;
pub mod stamp;
pub use self::stamp::Stamp;
pub mod stamp_history_entry;
Expand Down Expand Up @@ -238,7 +244,5 @@ pub mod web_rtc_authenticate_result;
pub use self::web_rtc_authenticate_result::WebRtcAuthenticateResult;
pub mod web_rtc_user_state;
pub use self::web_rtc_user_state::WebRtcUserState;
pub mod web_rtc_user_state_sessions_inner;
pub use self::web_rtc_user_state_sessions_inner::WebRtcUserStateSessionsInner;
pub mod webhook;
pub use self::webhook::Webhook;
8 changes: 7 additions & 1 deletion src/models/o_auth2_scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
/// OAuth2スコープ
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum OAuth2Scope {
#[serde(rename = "openid")]
Openid,
#[serde(rename = "profile")]
Profile,
#[serde(rename = "read")]
Read,
#[serde(rename = "write")]
Expand All @@ -24,6 +28,8 @@ pub enum OAuth2Scope {
impl ToString for OAuth2Scope {
fn to_string(&self) -> String {
match self {
Self::Openid => String::from("openid"),
Self::Profile => String::from("profile"),
Self::Read => String::from("read"),
Self::Write => String::from("write"),
Self::ManageBot => String::from("manage_bot"),
Expand All @@ -33,6 +39,6 @@ impl ToString for OAuth2Scope {

impl Default for OAuth2Scope {
fn default() -> OAuth2Scope {
Self::Read
Self::Openid
}
}
78 changes: 78 additions & 0 deletions src/models/oidc_traq_user_info.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* traQ v3
*
* traQ v3 API
*
* The version of the OpenAPI document: 3.0
*
* Generated by: https://openapi-generator.tech
*/

/// OidcTraqUserInfo : traQ特有のユーザー詳細情報

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct OidcTraqUserInfo {
/// 自己紹介(biography)
#[serde(rename = "bio")]
pub bio: String,
/// 所属グループのUUIDの配列
#[serde(rename = "groups")]
pub groups: Vec<uuid::Uuid>,
/// タグリスト
#[serde(rename = "tags")]
pub tags: Vec<crate::models::UserTag>,
/// 最終オンライン日時
#[serde(rename = "last_online", deserialize_with = "Option::deserialize")]
pub last_online: Option<String>,
/// Twitter ID
#[serde(rename = "twitter_id")]
pub twitter_id: String,
/// ユーザー表示名
#[serde(rename = "display_name")]
pub display_name: String,
/// アイコンファイルUUID
#[serde(rename = "icon_file_id")]
pub icon_file_id: uuid::Uuid,
/// BOTかどうか
#[serde(rename = "bot")]
pub bot: bool,
#[serde(rename = "state")]
pub state: crate::models::UserAccountState,
/// 所有している権限の配列
#[serde(rename = "permissions")]
pub permissions: Vec<crate::models::UserPermission>,
/// ホームチャンネル
#[serde(rename = "home_channel", deserialize_with = "Option::deserialize")]
pub home_channel: Option<uuid::Uuid>,
}

impl OidcTraqUserInfo {
/// traQ特有のユーザー詳細情報
pub fn new(
bio: String,
groups: Vec<uuid::Uuid>,
tags: Vec<crate::models::UserTag>,
last_online: Option<String>,
twitter_id: String,
display_name: String,
icon_file_id: uuid::Uuid,
bot: bool,
state: crate::models::UserAccountState,
permissions: Vec<crate::models::UserPermission>,
home_channel: Option<uuid::Uuid>,
) -> OidcTraqUserInfo {
OidcTraqUserInfo {
bio,
groups,
tags,
last_online,
twitter_id,
display_name,
icon_file_id,
bot,
state,
permissions,
home_channel,
}
}
}
Loading
Loading