mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 13:30:39 +08:00
chore: create v2 route for organization (#5679)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com>
This commit is contained in:
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
openapi: post /v2/organization
|
||||||
|
---
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
openapi: get /v2/organization/{organization_id}
|
||||||
|
---
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
openapi: put /v2/organization/{organization_id}
|
||||||
|
---
|
||||||
@ -34,6 +34,14 @@
|
|||||||
"essentials/go-live"
|
"essentials/go-live"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"group": "Organization",
|
||||||
|
"pages": [
|
||||||
|
"api-reference/organization/organization--create",
|
||||||
|
"api-reference/organization/organization--retrieve",
|
||||||
|
"api-reference/organization/organization--update"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"group": "Merchant Account",
|
"group": "Merchant Account",
|
||||||
"pages": [
|
"pages": [
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
"/organization": {
|
"/v2/organization": {
|
||||||
"post": {
|
"post": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"Organization"
|
"Organization"
|
||||||
@ -67,7 +67,7 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/organization/{organization_id}": {
|
"/v2/organization/{organization_id}": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"Organization"
|
"Organization"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#[cfg(any(feature = "v1", feature = "v2"))]
|
#[cfg(feature = "v1")]
|
||||||
/// Organization - Create
|
/// Organization - Create
|
||||||
///
|
///
|
||||||
/// Create a new organization
|
/// Create a new organization
|
||||||
@ -25,7 +25,7 @@
|
|||||||
)]
|
)]
|
||||||
pub async fn organization_create() {}
|
pub async fn organization_create() {}
|
||||||
|
|
||||||
#[cfg(any(feature = "v1", feature = "v2"))]
|
#[cfg(feature = "v1")]
|
||||||
/// Organization - Retrieve
|
/// Organization - Retrieve
|
||||||
///
|
///
|
||||||
/// Retrieve an existing organization
|
/// Retrieve an existing organization
|
||||||
@ -43,7 +43,7 @@ pub async fn organization_create() {}
|
|||||||
)]
|
)]
|
||||||
pub async fn organization_retrieve() {}
|
pub async fn organization_retrieve() {}
|
||||||
|
|
||||||
#[cfg(any(feature = "v1", feature = "v2"))]
|
#[cfg(feature = "v1")]
|
||||||
/// Organization - Update
|
/// Organization - Update
|
||||||
///
|
///
|
||||||
/// Create a new organization for .
|
/// Create a new organization for .
|
||||||
@ -70,3 +70,76 @@ pub async fn organization_retrieve() {}
|
|||||||
security(("admin_api_key" = []))
|
security(("admin_api_key" = []))
|
||||||
)]
|
)]
|
||||||
pub async fn organization_update() {}
|
pub async fn organization_update() {}
|
||||||
|
|
||||||
|
#[cfg(feature = "v2")]
|
||||||
|
/// Organization - Create
|
||||||
|
///
|
||||||
|
/// Create a new organization
|
||||||
|
#[utoipa::path(
|
||||||
|
post,
|
||||||
|
path = "/v2/organization",
|
||||||
|
request_body(
|
||||||
|
content = OrganizationRequest,
|
||||||
|
examples(
|
||||||
|
(
|
||||||
|
"Create an organization with organization_name" = (
|
||||||
|
value = json!({"organization_name": "organization_abc"})
|
||||||
|
)
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
responses(
|
||||||
|
(status = 200, description = "Organization Created", body =OrganizationResponse),
|
||||||
|
(status = 400, description = "Invalid data")
|
||||||
|
),
|
||||||
|
tag = "Organization",
|
||||||
|
operation_id = "Create an Organization",
|
||||||
|
security(("admin_api_key" = []))
|
||||||
|
)]
|
||||||
|
pub async fn organization_create() {}
|
||||||
|
|
||||||
|
#[cfg(feature = "v2")]
|
||||||
|
/// Organization - Retrieve
|
||||||
|
///
|
||||||
|
/// Retrieve an existing organization
|
||||||
|
#[utoipa::path(
|
||||||
|
get,
|
||||||
|
path = "/v2/organization/{organization_id}",
|
||||||
|
params (("organization_id" = String, Path, description = "The unique identifier for the Organization")),
|
||||||
|
responses(
|
||||||
|
(status = 200, description = "Organization Created", body =OrganizationResponse),
|
||||||
|
(status = 400, description = "Invalid data")
|
||||||
|
),
|
||||||
|
tag = "Organization",
|
||||||
|
operation_id = "Retrieve an Organization",
|
||||||
|
security(("admin_api_key" = []))
|
||||||
|
)]
|
||||||
|
pub async fn organization_retrieve() {}
|
||||||
|
|
||||||
|
#[cfg(feature = "v2")]
|
||||||
|
/// Organization - Update
|
||||||
|
///
|
||||||
|
/// Create a new organization for .
|
||||||
|
#[utoipa::path(
|
||||||
|
put,
|
||||||
|
path = "/v2/organization/{organization_id}",
|
||||||
|
request_body(
|
||||||
|
content = OrganizationRequest,
|
||||||
|
examples(
|
||||||
|
(
|
||||||
|
"Update organization_name of the organization" = (
|
||||||
|
value = json!({"organization_name": "organization_abcd"})
|
||||||
|
)
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
params (("organization_id" = String, Path, description = "The unique identifier for the Organization")),
|
||||||
|
responses(
|
||||||
|
(status = 200, description = "Organization Created", body =OrganizationResponse),
|
||||||
|
(status = 400, description = "Invalid data")
|
||||||
|
),
|
||||||
|
tag = "Organization",
|
||||||
|
operation_id = "Update an Organization",
|
||||||
|
security(("admin_api_key" = []))
|
||||||
|
)]
|
||||||
|
pub async fn organization_update() {}
|
||||||
|
|||||||
@ -1137,7 +1137,12 @@ impl Blocklist {
|
|||||||
|
|
||||||
#[cfg(feature = "olap")]
|
#[cfg(feature = "olap")]
|
||||||
pub struct Organization;
|
pub struct Organization;
|
||||||
#[cfg(feature = "olap")]
|
|
||||||
|
#[cfg(all(
|
||||||
|
feature = "olap",
|
||||||
|
any(feature = "v1", feature = "v2"),
|
||||||
|
not(feature = "merchant_account_v2")
|
||||||
|
))]
|
||||||
impl Organization {
|
impl Organization {
|
||||||
pub fn server(state: AppState) -> Scope {
|
pub fn server(state: AppState) -> Scope {
|
||||||
web::scope("/organization")
|
web::scope("/organization")
|
||||||
@ -1151,6 +1156,20 @@ impl Organization {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(all(feature = "v2", feature = "olap", feature = "merchant_account_v2"))]
|
||||||
|
impl Organization {
|
||||||
|
pub fn server(state: AppState) -> Scope {
|
||||||
|
web::scope("/v2/organization")
|
||||||
|
.app_data(web::Data::new(state))
|
||||||
|
.service(web::resource("").route(web::post().to(organization_create)))
|
||||||
|
.service(
|
||||||
|
web::resource("/{id}")
|
||||||
|
.route(web::get().to(organization_retrieve))
|
||||||
|
.route(web::put().to(organization_update)),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub struct MerchantAccount;
|
pub struct MerchantAccount;
|
||||||
|
|
||||||
#[cfg(all(feature = "v2", feature = "olap", feature = "merchant_account_v2"))]
|
#[cfg(all(feature = "v2", feature = "olap", feature = "merchant_account_v2"))]
|
||||||
|
|||||||
Reference in New Issue
Block a user