scufflecloud_core/services/
organization_invitations.rs1use crate::CoreConfig;
2use crate::operations::Operation;
3use crate::services::CoreSvc;
4
5#[async_trait::async_trait]
6impl<G: CoreConfig> pb::scufflecloud::core::v1::organization_invitations_service_server::OrganizationInvitationsService
7 for CoreSvc<G>
8{
9 async fn create_organization_invitation(
10 &self,
11 req: tonic::Request<pb::scufflecloud::core::v1::CreateOrganizationInvitationRequest>,
12 ) -> Result<tonic::Response<pb::scufflecloud::core::v1::OrganizationInvitation>, tonic::Status> {
13 Operation::<G>::run(req).await.map(tonic::Response::new)
14 }
15
16 async fn list_organization_invitations_by_organization(
17 &self,
18 req: tonic::Request<pb::scufflecloud::core::v1::ListOrganizationInvitationsByOrganizationRequest>,
19 ) -> Result<tonic::Response<pb::scufflecloud::core::v1::OrganizationInvitationList>, tonic::Status> {
20 Operation::<G>::run(req).await.map(tonic::Response::new)
21 }
22
23 async fn list_orgnization_invites_by_user(
24 &self,
25 req: tonic::Request<pb::scufflecloud::core::v1::ListOrgnizationInvitesByUserRequest>,
26 ) -> Result<tonic::Response<pb::scufflecloud::core::v1::OrganizationInvitationList>, tonic::Status> {
27 Operation::<G>::run(req).await.map(tonic::Response::new)
28 }
29
30 async fn get_organization_invitation(
31 &self,
32 req: tonic::Request<pb::scufflecloud::core::v1::GetOrganizationInvitationRequest>,
33 ) -> Result<tonic::Response<pb::scufflecloud::core::v1::OrganizationInvitation>, tonic::Status> {
34 Operation::<G>::run(req).await.map(tonic::Response::new)
35 }
36
37 async fn accept_organization_invitation(
38 &self,
39 req: tonic::Request<pb::scufflecloud::core::v1::AcceptOrganizationInvitationRequest>,
40 ) -> Result<tonic::Response<pb::scufflecloud::core::v1::OrganizationMember>, tonic::Status> {
41 Operation::<G>::run(req).await.map(tonic::Response::new)
42 }
43
44 async fn decline_organization_invitation(
45 &self,
46 req: tonic::Request<pb::scufflecloud::core::v1::DeclineOrganizationInvitationRequest>,
47 ) -> Result<tonic::Response<()>, tonic::Status> {
48 Operation::<G>::run(req).await.map(tonic::Response::new)
49 }
50}