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:
Hrithikesh
2024-08-26 12:20:11 +05:30
committed by GitHub
parent 800da6a16a
commit 0eaadc42b7
7 changed files with 115 additions and 6 deletions

View File

@ -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() {}