gbiz-info-api 0.2.0

gBizINFO REST API (v2) を Rust から利用するためのクライアントライブラリ
Documentation
//! [gBizINFO REST API (v2)](https://info.gbiz.go.jp/) の Rust クライアント。
//!
//! gBizINFO は経済産業省が提供する法人情報サイトで、法人として登記されている約400万社を対象に、
//! 法人番号・法人名・本社所在地に加え、届出・認定、表彰、財務、特許、調達、補助金、職場情報などの
//! 法人活動情報を取得できる。
//!
//! # セットアップ
//!
//! API トークンを [Web API利用申請](https://info.gbiz.go.jp/hojin/various_registration/form)で取得し、
//! [`GbizInfoClient::new`] に渡す。
//!
//! # 使い方
//!
//! ```no_run
//! use gbiz_info_api::{GbizInfoClient, HojinSearchQuery, UpdateInfoQuery};
//!
//! # async fn example() -> Result<(), gbiz_info_api::GbizError> {
//! let client = GbizInfoClient::new("YOUR_API_TOKEN");
//!
//! // 法人検索
//! let res = client
//!     .search(&HojinSearchQuery::new().name("トヨタ自動車").limit(10))
//!     .await?;
//! for info in res.into_hojin_infos() {
//!     println!("{}", info.name.unwrap_or_default());
//! }
//!
//! // 法人番号を指定して基本情報を取得
//! let res = client.hojin("1180301018771").await?;
//!
//! // メタデータ(出典元・最終更新日等)付きで財務情報を取得
//! let res = client.finance("1180301018771").metadata_flg(true).await?;
//!
//! // 期間内に追加/更新された法人基本情報を取得(ページング付き)
//! let res = client
//!     .update_info(&UpdateInfoQuery::new("20260401", "20260430"))
//!     .await?;
//! # Ok(())
//! # }
//! ```
//!
//! # エラーハンドリング
//!
//! すべての API 呼び出しは [`Result<_, GbizError>`](GbizError) を返す。
//! HTTP ステータスエラーはレスポンスボディ付きの [`GbizError::Status`] になる。
//!
//! ```no_run
//! # use gbiz_info_api::{GbizInfoClient, GbizError};
//! # async fn example(client: GbizInfoClient) {
//! match client.hojin("0000000000000").await {
//!     Ok(res) => { /* ... */ }
//!     Err(err) if err.is_not_found() => eprintln!("法人が見つかりません"),
//!     Err(GbizError::Status { status, body }) => eprintln!("API エラー {status}: {body}"),
//!     Err(err) => eprintln!("通信エラー等: {err}"),
//! }
//! # }
//! ```
//!
//! # 対応エンドポイント
//!
//! | [`GbizInfoClient`] のメソッド | エンドポイント | レスポンス |
//! | --- | --- | --- |
//! | [`search`](GbizInfoClient::search) | `GET /v2/hojin` | [`SearchResponse`] |
//! | [`hojin`](GbizInfoClient::hojin) | `GET /v2/hojin/{corporate_number}` | [`HojinResponse`] |
//! | [`certification`](GbizInfoClient::certification) | `GET /v2/hojin/{corporate_number}/certification` | [`HojinChildResponse`] |
//! | [`commendation`](GbizInfoClient::commendation) | `GET /v2/hojin/{corporate_number}/commendation` | [`HojinChildResponse`] |
//! | [`corporation`](GbizInfoClient::corporation) | `GET /v2/hojin/{corporate_number}/corporation` | [`HojinChildResponse`] |
//! | [`finance`](GbizInfoClient::finance) | `GET /v2/hojin/{corporate_number}/finance` | [`HojinChildResponse`] |
//! | [`patent`](GbizInfoClient::patent) | `GET /v2/hojin/{corporate_number}/patent` | [`HojinChildResponse`] |
//! | [`procurement`](GbizInfoClient::procurement) | `GET /v2/hojin/{corporate_number}/procurement` | [`HojinChildResponse`] |
//! | [`subsidy`](GbizInfoClient::subsidy) | `GET /v2/hojin/{corporate_number}/subsidy` | [`HojinChildResponse`] |
//! | [`workplace`](GbizInfoClient::workplace) | `GET /v2/hojin/{corporate_number}/workplace` | [`HojinChildResponse`] |
//! | [`update_info`](GbizInfoClient::update_info) | `GET /v2/hojin/updateInfo` | [`UpdateInfoHojinResponse`] |
//! | [`update_info_certification`](GbizInfoClient::update_info_certification) | `GET /v2/hojin/updateInfo/certification` | [`UpdateInfoChildResponse`] |
//! | [`update_info_commendation`](GbizInfoClient::update_info_commendation) | `GET /v2/hojin/updateInfo/commendation` | [`UpdateInfoChildResponse`] |
//! | [`update_info_corporation`](GbizInfoClient::update_info_corporation) | `GET /v2/hojin/updateInfo/corporation` | [`UpdateInfoChildResponse`] |
//! | [`update_info_finance`](GbizInfoClient::update_info_finance) | `GET /v2/hojin/updateInfo/finance` | [`UpdateInfoChildResponse`] |
//! | [`update_info_patent`](GbizInfoClient::update_info_patent) | `GET /v2/hojin/updateInfo/patent` | [`UpdateInfoChildResponse`] |
//! | [`update_info_procurement`](GbizInfoClient::update_info_procurement) | `GET /v2/hojin/updateInfo/procurement` | [`UpdateInfoChildResponse`] |
//! | [`update_info_subsidy`](GbizInfoClient::update_info_subsidy) | `GET /v2/hojin/updateInfo/subsidy` | [`UpdateInfoChildResponse`] |
//! | [`update_info_workplace`](GbizInfoClient::update_info_workplace) | `GET /v2/hojin/updateInfo/workplace` | [`UpdateInfoChildResponse`] |
//!
//! # 関連リンク
//!
//! - [gBizINFO](https://info.gbiz.go.jp/)
//! - [API 仕様 (Swagger UI, v2)](https://api.info.gbiz.go.jp/hojin/swagger-ui/index.html?urls.primaryName=v2)
//! - [Web API利用申請](https://info.gbiz.go.jp/hojin/various_registration/form)

#![warn(missing_docs)]
#![warn(rustdoc::broken_intra_doc_links)]

pub mod client;
pub mod error;
pub mod query;
pub mod types;

pub use client::{DetailRequest, GbizInfoClient, GbizInfoClientBuilder, DEFAULT_BASE_URL};
pub use error::GbizError;
pub use query::{HojinSearchQuery, UpdateInfoQuery};
pub use types::*;