MCPcopy Create free account
hub / github.com/dfinity/orbit / create_request

Method create_request

core/station/impl/src/controllers/request.rs:145–169  ·  view source on GitHub ↗
(
        &self,
        input: CreateRequestInput,
        msg_arg_data_size: usize,
    )

Source from the content-addressed store, hash-verified

143 #[with_middleware(guard = authorize(&call_context(), &[Resource::from(&input)]))]
144 #[with_middleware(tail = use_canister_call_metric("create_request", &result))]
145 async fn create_request(
146 &self,
147 input: CreateRequestInput,
148 msg_arg_data_size: usize,
149 ) -> ApiResult<CreateRequestResponse> {
150 let ctx = &call_context();
151
152 // rate-limiting
153 rate_limit_create_request(ctx, msg_arg_data_size).await?;
154
155 let request = self.request_service.create_request(input, ctx).await?;
156 let privileges = self
157 .request_service
158 .get_caller_privileges_for_request(&request.id, ctx)
159 .await?;
160 let additional_info = self
161 .request_service
162 .get_request_additional_info(&request, true)?;
163
164 Ok(CreateRequestResponse {
165 request: request.to_dto(),
166 privileges: privileges.into(),
167 additional_info: additional_info.into(),
168 })
169 }
170
171 #[with_middleware(guard = authorize(&call_context(), &[Resource::from(&input)]))]
172 #[with_middleware(tail = use_canister_call_metric("cancel_request", &result))]

Callers 1

create_requestFunction · 0.45

Calls 5

call_contextFunction · 0.50
to_dtoMethod · 0.45

Tested by

no test coverage detected