package com.bocloud.ims.interfaces.resource.azure.blob;

import com.alibaba.fastjson.JSONObject;
import com.bocloud.cmp.model.DeleteParam;
import com.bocloud.common.model.BocloudResult;
import com.bocloud.common.model.GridBean;
import com.bocloud.common.model.Pager;
import com.bocloud.common.model.RequestContext;
import com.bocloud.ims.entity.resource.azure.blob.Container;

import java.util.Map;

/**
 * azure存储容器业务接口
 *
 * @author wangyu
 * @version 5.0.0-SNAPSHOT
 * @since 2021/2/2
 */
public interface ContainerService {

    /**
     * 查询列表
     *
     * @param pager
     * @param context
     * @return
     */
    BocloudResult<GridBean<Container>> list(Pager pager, RequestContext context);

    /**
     * 创建容器
     *
     * @param container
     * @param context
     * @return
     */
    BocloudResult<Container> create(Container container, RequestContext context);

    /**
     * 修改容器
     *
     * @param container
     * @param context
     * @return
     */
    BocloudResult<Container> modify(Container container, RequestContext context);

    /**
     * 查询容器详情
     *
     * @param id
     * @param context
     * @return
     */
    BocloudResult<Container> detail(Long id, RequestContext context);

    /**
     * 删除容器
     *
     * @param id
     * @param context
     * @return
     */
    BocloudResult remove(Long id, RequestContext context);

    /**
     * 批量删除容器
     *
     * @param params
     * @param context
     * @return
     */
    BocloudResult batchRemove(DeleteParam params, RequestContext context);

    /**
     * 更新元数据
     *
     * @param id
     * @param metadata
     * @param context
     * @return
     */
    BocloudResult updateMetadata(Long id, Map<String, String> metadata, RequestContext context);

    /**
     * 资源分配
     *
     * @param object
     * @param context
     * @return
     */
    BocloudResult assign(JSONObject object, RequestContext context);

    /**
     * 容器操作
     *
     * @param id
     * @param action
     * @param params
     * @param context
     * @return
     */
    BocloudResult action(Long id, String action, JSONObject params, RequestContext context);
}
