pub async fn handle_delete_spu_groups_request<C>(
    request: RequestMessage<FlvDeleteSpuGroupsRequest>,
    ctx: &PublicContext<C>,
) -> Result<ResponseMessage<FlvDeleteSpuGroupsResponse>, Error>
where
    C: MetadataClient,
{
    let mut response = FlvDeleteSpuGroupsResponse::default();
    let mut results: Vec<FlvResponseMessage> = vec![];

    debug!(
        ">>>>>>>>>>> DELETE SPU GROUP REQ GOES HERE {:#?}",
        request.request
    );

    for spg_name in &request.request.spu_groups {
        debug!("api request: delete spu group '{}'", spg_name);

        let result = match ctx.delete::<SpuGroupSpec>(spg_name).await {
            Ok(_) => FlvResponseMessage::new_ok(spg_name.clone()),
            Err(err) => {
                let error = Some(err.to_string());
                FlvResponseMessage::new(spg_name.clone(), FlvErrorCode::SpuError, error)
            }
        };

        results.push(result);
    }

    // update response
    response.results = results;
    trace!("flv delete spu group resp {:#?}", response);

    Ok(request.new_response(response))
}
/// Handler for delete spu group request
Handler for delete spu group request
Handler for delete spu group request
pub async fn handle_delete_spu_groups_request<C>(
    request: RequestMessage<FlvDeleteSpuGroupsRequest>,
    ctx: &PublicContext<C>,
) -> Result<ResponseMessage<FlvDeleteSpuGroupsResponse>, Error>
where
    C: MetadataClient,
{
    let mut response = FlvDeleteSpuGroupsResponse::default();
    let mut results: Vec<FlvResponseMessage> = vec![];
    debug!(
        ">>>>>>>>>>> DELETE SPU GROUP REQ GOES HERE {:#?}",
        request.request
    );
    for spg_name in &request.request.spu_groups {
        debug!("api request: delete spu group '{}'", spg_name);
        let result = match ctx.delete::<SpuGroupSpec>(spg_name).await {
            Ok(_) => FlvResponseMessage::new_ok(spg_name.clone()),
            Err(err) => {
                let error = Some(err.to_string());
                FlvResponseMessage::new(spg_name.clone(), FlvErrorCode::SpuError, error)
            }
        };
        results.push(result);
    }
    // update response
    response.results = results;
    trace!("flv delete spu group resp {:#?}", response);
    Ok(request.new_response(response))
}
pub async fn handle_delete_spu_groups_request < C > ( request : RequestMessage < FlvDeleteSpuGroupsRequest > , ctx : & PublicContext < C > , ) -> Result < ResponseMessage < FlvDeleteSpuGroupsResponse > , Error > where C : MetadataClient , { let mut response = FlvDeleteSpuGroupsResponse :: default ( ) ; let mut results : Vec < FlvResponseMessage > = vec ! [ ] ; debug ! ( " " request request ) ; for spg_name in & request . request . spu_groups { debug ! ( " " spg_name ) ; let result = match ctx . delete :: < SpuGroupSpec > ( spg_name ) . await { Ok ( _ ) => FlvResponseMessage :: new_ok ( spg_name . clone ( ) ) , Err ( err ) => { let error = Some ( err . to_string ( ) ) ; FlvResponseMessage :: new ( spg_name . clone ( ) , FlvErrorCode :: SpuError , error ) } } ; results . push ( result ) ; } // update response response . results = results ; trace ! ( " " response ) ; Ok ( request . new_response ( response ) ) }
Handler for delete spu group request
Handler for delete spu group request
request
RequestMessage<FlvDeleteSpuGroupsRequest>
ctx
&PublicContext<C>
request
RequestMessage<FlvDeleteSpuGroupsRequest>
ctx
&PublicContext<C>