package response

type FileManagerActionLocation struct {
	FolderID string `json:"folder_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
}

type FileManagerActionResultAttributes struct {
	Status   string                     `json:"status" example:"trashed"`
	Location *FileManagerActionLocation `json:"location,omitempty"`
}

type FileManagerActionResultResource struct {
	Type       string                            `json:"type" example:"file_manager_delete_result"`
	ID         string                            `json:"id" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	Attributes FileManagerActionResultAttributes `json:"attributes"`
}

type FileManagerActionResultResponse struct {
	Data FileManagerActionResultResource `json:"data"`
}

type FileManagerMoveNodeResultAttributes struct {
	NodeType string                     `json:"node_type" example:"folder"`
	Status   string                     `json:"status" example:"moved"`
	Location *FileManagerActionLocation `json:"location,omitempty"`
}

type FileManagerMoveNodeResultResource struct {
	Type       string                              `json:"type" example:"file_manager_move_result"`
	ID         string                              `json:"id" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	Attributes FileManagerMoveNodeResultAttributes `json:"attributes"`
}

type FileManagerActionBulkError struct {
	Status    int    `json:"status" example:"422"`
	Code      string `json:"code,omitempty" example:"FILE_MANAGER_VALIDATION_FAILED"`
	ErrorCode string `json:"error_code,omitempty" example:"4222111"`
	Title     string `json:"title" example:"Validation error"`
	Detail    string `json:"detail" example:"duplicate name in target folder"`
}

type FileManagerMoveNodeBulkItem struct {
	Index    int                                `json:"index" example:"0"`
	Success  bool                               `json:"success" example:"true"`
	Resource *FileManagerMoveNodeResultResource `json:"resource,omitempty"`
	Error    *FileManagerActionBulkError        `json:"error,omitempty"`
}

type FileManagerMoveNodeBulkResponse struct {
	Data []FileManagerMoveNodeBulkItem `json:"data"`
	Meta struct {
		Total          int  `json:"total" example:"3"`
		Success        int  `json:"success" example:"2"`
		Failed         int  `json:"failed" example:"1"`
		PartialSuccess bool `json:"partial_success" example:"true"`
	} `json:"meta"`
}

type FileManagerPurgeNodeResultAttributes struct {
	NodeType string `json:"node_type" example:"folder"`
	Status   string `json:"status" example:"purged"`
}

type FileManagerPurgeNodeResultResource struct {
	Type       string                               `json:"type" example:"file_manager_purge_result"`
	ID         string                               `json:"id" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
	Attributes FileManagerPurgeNodeResultAttributes `json:"attributes"`
}

type FileManagerPurgeNodeBulkItem struct {
	Index    int                                 `json:"index" example:"0"`
	Success  bool                                `json:"success" example:"true"`
	Resource *FileManagerPurgeNodeResultResource `json:"resource,omitempty"`
	Error    *FileManagerActionBulkError         `json:"error,omitempty"`
}

type FileManagerPurgeNodeBulkResponse struct {
	Data []FileManagerPurgeNodeBulkItem `json:"data"`
	Meta struct {
		Total          int  `json:"total" example:"3"`
		Success        int  `json:"success" example:"2"`
		Failed         int  `json:"failed" example:"1"`
		PartialSuccess bool `json:"partial_success" example:"true"`
	} `json:"meta"`
}
