mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 11:06:50 +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:
@ -1,4 +1,4 @@
|
||||
#[cfg(any(feature = "v1", feature = "v2"))]
|
||||
#[cfg(feature = "v1")]
|
||||
/// Organization - Create
|
||||
///
|
||||
/// Create a new organization
|
||||
@ -25,7 +25,7 @@
|
||||
)]
|
||||
pub async fn organization_create() {}
|
||||
|
||||
#[cfg(any(feature = "v1", feature = "v2"))]
|
||||
#[cfg(feature = "v1")]
|
||||
/// Organization - Retrieve
|
||||
///
|
||||
/// Retrieve an existing organization
|
||||
@ -43,7 +43,7 @@ pub async fn organization_create() {}
|
||||
)]
|
||||
pub async fn organization_retrieve() {}
|
||||
|
||||
#[cfg(any(feature = "v1", feature = "v2"))]
|
||||
#[cfg(feature = "v1")]
|
||||
/// Organization - Update
|
||||
///
|
||||
/// Create a new organization for .
|
||||
@ -70,3 +70,76 @@ pub async fn organization_retrieve() {}
|
||||
security(("admin_api_key" = []))
|
||||
)]
|
||||
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() {}
|
||||
|
||||
Reference in New Issue
Block a user