Skill: squall0925/umeng-api (version 1.0.0)

--- name: umeng-api description: 查询友盟 (UMeng) 应用统计数据分析，支持通过 APPKEY 获取应用的基础指标信息如新增用户数、活跃用户数等。当用户提到"友盟"、"umeng"、"APPKEY"、"新增用户"、"活跃用户"或需要查询应用统计数据时使用此技能。 --- # 友盟 API 技能 ## 功能概述 此技能提供友盟开放 API 的完整 Python SDK 封装，用于查询应用的统计数据，包括： - 新增用户数 - 活跃用户数 - 异常点检测（异动归因报告） - 其他友盟 UApp API 支持的指标 ## 前置条件 1. **友盟账号**：需要有效的友盟开发者账号 2. **应用 APPKEY**：目标应用的友盟 APPKEY 3. **API 认证**：需要 apiKey 和 apiSecurity（从友盟开发者平台获取） ## 安装依赖 技能已包含完整的友盟 AOP SDK，无需额外安装。 ## 使用方法 ### 1. 配置认证信息 **认证信息获取优先级**（从高到低）： 1. 代码中直接传入的参数 2. `umeng-config.json` 配置文件（推荐） 3. 环境变量 #### 方式一：使用配置文件（推荐） 创建 `umeng-config.json` 文件，可以放在以下任一位置： - 当前工作目录 - 用户主目录 (`~/umeng-config.json`) - 技能目录 ```json { "apiKey": "your_api_key", "apiSecurity": "your_api_security", "note": "友盟 API 配置文件 - 请妥善保管，不要提交到版本控制系统" } ``` ⚠️ **安全提示**：建议将配置文件权限设置为仅所有者可读写（`chmod 600 umeng-config.json`） #### 方式二：使用环境变量 ```bash export UMENG_API_KEY="your_api_key" export UMENG_API_SECURITY="your_api_security" ``` #### 方式三：代码中直接设置 ```python import aop aop.set_default_appinfo(your_api_key, your_api_security) ``` ### 2. 查询新增用户数 ```python import aop import aop.api # 设置友盟 API 服务器 aop.set_default_server('gateway.open.umeng.com') # 认证信息会自动从 umeng-config.json 或环境变量加载 # 也可以手动设置：aop.set_default_appinfo(apiKey, apiSecurity) # 查询新增用户 req = aop.api.UmengUappGetNewUsersRequest() resp = req.get_response(None, appkey="your_appkey", startDate="2026-03-25", endDate="2026-03-25", periodType="daily") print(f"新增用户数：{resp['newUserInfo'][0]['value']}") ``` ### 3. 查询活跃用户数 ```python # 查询活跃用户 req = aop.api.UmengUappGetActiveUsersRequest() resp = req.get_response(None, appkey="your_appkey", startDate="2026-03-25", endDate="2026-03-25", periodType="daily") print(f"活跃用户数：{resp['activeUserInfo'][0]['value']}") ``` ## 完整示例 ### 1. 查询基础统计数据 ```python import os import aop import aop.api def query_umeng_stats(appkey, date_str=None): """查询友盟应用统计数据""" if date_str is None: from datetime import date date_str = date.today().strftime("%Y-%m-%d") # 设置友盟 API 服务器 aop.set_default_server('gateway.open.umeng.com') # 认证信息会自动从 umeng-config.json 或环境变量加载 # 检查是否成功加载 appinfo = aop.get_default_appinfo() if not appinfo: raise ValueError("未找到友盟认证信息，请配置 umeng-config.json 或环境变量") # 查询新增用户 new_users_req = aop.api.UmengUappGetNewUsersRequest() new_users_resp = new_users_req.get_response(None, appkey=appkey, startDate=date_str, endDate=date_str, periodType="daily") new_users = new_users_resp['newUserInfo'][0]['value'] # 查询活跃用户 active_users_req = aop.api.UmengUappGetActiveUsersRequest() active_users_resp = active_users_req.get_response(None, appkey=appkey, startDate=date_str, endDate=date_str, periodType="daily") active_users = active_users_resp['activeUserInfo'][0]['value'] return { "date": date_str, "appkey": appkey, "new_users": new_users, "active_users": active_users } # 使用示例 if __name__ == "__main__": result = query_umeng_stats("64abc640a1a164591b48bb0c") print(f"日期：{result['date']}") print(f"新增用户：{result['new_users']}") print(f"活跃用户：{result['active_users']}") ``` ### 2. 查询异常点检测数据 ```python import os from umeng_get_outlier_points import get_umeng_outlier_points, format_outlier_report def query_umeng_outlier(appkey, ds): """查询友盟应用异常点数据""" # 认证信息会自动从 umeng-config.json 或环境变量加载 # 也可以直接传入：get_umeng_outlier_points(appkey, ds, api_key, api_security) # 查询异常点 outlier_data = get_umeng_outlier_points(appkey, ds) return outlier_data # 使用示例 if __name__ == "__main__": try: appkey = "59892f08310c9307b60023d0" ds = "20260322" # YYYYMMDD 格式 outlier_data = query_umeng_outlier(appkey, ds) print(format_outlier_report(outlier_data)) except Exception as e: print(f"Error: {e}") ``` ## 支持的其他 API 接口 SDK 还支持以下接口（位于 `aop/api/biz/` 目录）： - `UmengUappGetLaunchesRequest` - 启动次数 - `UmengUappGetDurationsRequest` - 使用时长 - `UmengUappGetRetentionsRequest` - 留存率 - `UmengUappGetChannelDataRequest` - 渠道数据 - `UmengUappGetVersionDataRequest` - 版本数据 - 以及更多... ## 错误处理 常见的异常类型： - `aop.ApiError` - API 网关返回的错误 - `aop.AopError` - 客户端请求前的错误 - `ValueError` - 认证信息未找到（检查 umeng-config.json 或环境变量） - `Exception` - 其他未知异常 ## 安全注意事项 1. **不要硬编码认证信息**：优先使用 `umeng-config.json` 配置文件或环境变量 2. **保护配置文件**：将 `umeng-config.json` 添加到 `.gitignore`，避免提交到版本控制 3. **文件权限**：建议设置 `chmod 600 umeng-config.json` 限制访问 4. **API 调用频率**：友盟 API 有调用频率限制，请合理控制请求频次 ## 技能目录结构 ``` umeng-api/ ├── SKILL.md ├── umeng_config.py # 配置管理模块（新增） ├── umeng_get_outlier_points.py # 异常点检测封装 ├── aop/ # 友盟 AOP SDK │ ├── __init__.py # 已更新，支持配置文件加载 │ └── api/ │ ├── __init__.py │ ├── base.py │ ├── common/ │ └── biz/ # 所有友盟 API 接口 └── scripts/ ``` ## 使用示例场景 当用户说： - "查询 APPKEY 为 xxx 的应用今天新增用户数" - "友盟统计中 xxx 应用的活跃用户是多少" - "获取 umeng 应用 xxx 的昨日数据" - "查询 APPKEY 为 xxx 在 YYYY-MM-DD 的异常点报告" - "获取友盟异动归因报告链接" 技能会自动： 1. 从 `umeng-config.json` 加载认证信息（如果存在） 2. 否则从环境变量加载 3. 提取 APPKEY，使用当前日期（或指定日期） 4. 调用相应 API 并返回结果 ## 配置文件示例 **umeng-config.json**: ```json { "apiKey": "12345678", "apiSecurity": "your_api_security_here" } ``` **位置优先级**： 1. `./umeng-config.json` (当前工作目录) 2. `~/umeng-config.json` (用户主目录) 3. `<skill-dir>/umeng-config.json` (技能目录)

path: UPDATE_LOG.md
content: # umeng-api 技能更新日志

## 2026-03-31 - 添加配置文件支持

### 更新内容

1. **新增 `umeng_config.py` 模块**
   - 支持从 `umeng-config.json` 配置文件读取认证信息
   - 支持多种字段名（`apiKey`/`api_key`/`UMENG_API_KEY`）
   - 提供 `get_umeng_credentials()` 函数，按优先级获取认证信息
   - 提供 `save_config()` 函数用于保存配置

2. **更新 `umeng_get_outlier_points.py`**
   - 集成 `umeng_config` 模块
   - 认证信息获取优先级：参数 > 配置文件 > 环境变量
   - 改进错误提示，明确告知用户如何配置

3. **更新 `aop/__init__.py`**
   - 添加 `_load_umeng_config()` 函数
   - 修改 `get_default_appinfo()` 自动从配置文件或环境变量加载认证信息
   - 保持向后兼容，支持手动 `set_default_appinfo()`

4. **更新 `SKILL.md` 文档**
   - 详细说明三种认证配置方式
   - 添加配置文件示例和安全提示
   - 更新代码示例，展示自动加载认证信息

5. **新增示例文件**
   - `umeng-config.json.example` - 配置文件模板

6. **更新 `TOOLS.md`**
   - 添加友盟 API 配置说明

### 认证信息优先级

从高到低：
1. 代码中直接传入的参数（`api_key`, `api_security`）
2. `umeng-config.json` 配置文件
3. 环境变量（`UMENG_API_KEY`, `UMENG_API_SECURITY`）

### 配置文件位置

按以下顺序查找：
1. 当前工作目录 (`./umeng-config.json`)
2. 用户主目录 (`~/umeng-config.json`)
3. 技能目录 (`<skill-dir>/umeng-config.json`)

### 安全建议

- 将 `umeng-config.json` 添加到 `.gitignore`
- 设置文件权限：`chmod 600 umeng-config.json`
- 不要将认证信息硬编码到代码中

### 向后兼容性

所有更新保持向后兼容：
- 原有的环境变量方式继续有效
- 原有的 `set_default_appinfo()` 方式继续有效
- 现有代码无需修改即可使用新的配置文件功能


path: umeng_get_outlier_points.py
content: #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
友盟异常点检测接口封装
用于获取应用异动点的简要信息和归因报告链接

认证信息获取优先级：
1. 直接传入的参数（api_key, api_security）
2. umeng-config.json 配置文件
3. 环境变量（UMENG_API_KEY, UMENG_API_SECURITY）
"""

import os
import sys
import requests
import json
from datetime import datetime

# 导入配置管理模块
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from umeng_config import get_umeng_credentials


def get_umeng_outlier_points(appkey, ds, api_key=None, api_security=None):
    """
    获取友盟应用异常点数据
    
    Args:
        appkey (str): 应用唯一标识符
        ds (str): 查询日期，格式：YYYYMMDD
        api_key (str, optional): 友盟 OpenAPI Key（优先级最高）
        api_security (str, optional): 友盟 OpenAPI Security（优先级最高）
        
    Returns:
        dict: 异常点数据，包含 shareUrl（异动归因报告地址）
        
    Raises:
        ValueError: 认证信息未找到
        Exception: API 调用失败或认证错误
    """
    # 获取认证信息（按优先级：参数 > 配置文件 > 环境变量）
    try:
        creds = get_umeng_credentials(api_key, api_security)
        [REDACTED_SECRET]'apiKey']
        api_security = creds['apiSecurity']
    except ValueError as e:
        raise ValueError(str(e))
    
    # 构建请求 URL
    base_url = "https://mobile.umeng.com/ht/api/v3/ai/getOutlierPoints"
    params = {
        "ak": api_key,
        "sk": api_security,
        "appkey": appkey,
        "ds": ds
    }
    
    try:
        # 发送 GET 请求
        response = requests.get(base_url, params=params, timeout=30)
        response.raise_for_status()
        
        # 解析响应
        result = response.json()
        
        # 检查 API 响应状态
        if not result.get("status", False):
            raise Exception(f"API call failed: {result.get('msg', 'Unknown error')}")
        
        # 提取应用数据
        app_data = result.get("data", {}).get(appkey, {})
        if not app_data:
            raise Exception(f"No data found for appkey: {appkey}")
        
        return {
            "appKey": app_data.get("appKey"),
            "shareUrl": app_data.get("shareUrl"),
            "id": app_data.get("id"),
            "category": app_data.get("category"),
            "type": app_data.get("type"),
            "ds": app_data.get("ds"),
            "status": app_data.get("status"),
            "raw_response": result  # 保留原始响应供调试
        }
        
    except requests.exceptions.RequestException as e:
        raise Exception(f"HTTP request failed: {str(e)}")
    except json.JSONDecodeError as e:
        raise Exception(f"Invalid JSON response: {str(e)}")
    except Exception as e:
        raise Exception(f"Failed to get outlier points: {str(e)}")


def format_outlier_report(outlier_data):
    """
    格式化异常点报告信息
    
    Args:
        outlier_data (dict): get_umeng_outlier_points 返回的数据
        
    Returns:
        str: 格式化的报告字符串
    """
    if not outlier_data:
        return "No outlier data available"
    
    report = f"""友盟异常点检测报告
==================

应用标识：{outlier_data.get('appKey', 'N/A')}
检测日期：{outlier_data.get('ds', 'N/A')}
异常类别：{outlier_data.get('category', 'N/A')}
异常级别：{outlier_data.get('type', 'N/A')}
报告状态：{'有效' if outlier_data.get('status') == 1 else '无效'}

📊 完整归因报告：{outlier_data.get('shareUrl', 'N/A')}

报告 ID: {outlier_data.get('id', 'N/A')}
"""
    return report


# 使用示例
if __name__ == "__main__":
    try:
        # 查询指定应用和日期的异常点
        appkey = "59892f08310c9307b60023d0"
        ds = "20260322"  # YYYYMMDD 格式
        
        outlier_data = get_umeng_outlier_points(appkey, ds)
        print(format_outlier_report(outlier_data))
        
    except Exception as e:
        print(f"Error: {e}")


path: scripts/quick_validate.py
content: #!/usr/bin/env python3
"""
Quick validation script for skills - minimal version
"""

import re
import sys
from pathlib import Path
from typing import Optional

try:
    import yaml
except ModuleNotFoundError:
    yaml = None

MAX_SKILL_NAME_LENGTH = 64


def _extract_frontmatter(content: str) -> Optional[str]:
    lines = content.splitlines()
    if not lines or lines[0].strip() != "---":
        return None
    for i in range(1, len(lines)):
        if lines[i].strip() == "---":
            return "\n".join(lines[1:i])
    return None


def _parse_simple_frontmatter(frontmatter_text: str) -> Optional[dict[str, str]]:
    """
    Minimal fallback parser used when PyYAML is unavailable.
    Supports simple `key: value` mappings used by SKILL.md frontmatter.
    """
    parsed: dict[str, str] = {}
    current_key: Optional[str] = None
    for raw_line in frontmatter_text.splitlines():
        stripped = raw_line.strip()
        if not stripped or stripped.startswith("#"):
            continue

        is_indented = raw_line[:1].isspace()
        if is_indented:
            if current_key is None:
                return None
            current_value = parsed[current_key]
            parsed[current_key] = (
                f"{current_value}\n{stripped}" if current_value else stripped
            )
            continue

        if ":" not in stripped:
            return None
        key, value = stripped.split(":", 1)
        key = key.strip()
        value = value.strip()
        if not key:
            return None
        if (value.startswith('"') and value.endswith('"')) or (
            value.startswith("'") and value.endswith("'")
        ):
            value = value[1:-1]
        parsed[key] = value
        current_key = key
    return parsed


def validate_skill(skill_path):
    """Basic validation of a skill"""
    skill_path = Path(skill_path)

    skill_md = skill_path / "SKILL.md"
    if not skill_md.exists():
        return False, "SKILL.md not found"

    try:
        content = skill_md.read_text(encoding="utf-8")
    except OSError as e:
        return False, f"Could not read SKILL.md: {e}"

    frontmatter_text = _extract_frontmatter(content)
    if frontmatter_text is None:
        return False, "Invalid frontmatter format"
    if yaml is not None:
        try:
            frontmatter = yaml.safe_load(frontmatter_text)
            if not isinstance(frontmatter, dict):
                return False, "Frontmatter must be a YAML dictionary"
        except yaml.YAMLError as e:
            return False, f"Invalid YAML in frontmatter: {e}"
    else:
        frontmatter = _parse_simple_frontmatter(frontmatter_text)
        if frontmatter is None:
            return (
                False,
                "Invalid YAML in frontmatter: unsupported syntax without PyYAML installed",
            )

    allowed_properties = {"name", "description", "license", "allowed-tools", "metadata"}

    unexpected_keys = set(frontmatter.keys()) - allowed_properties
    if unexpected_keys:
        allowed = ", ".join(sorted(allowed_properties))
        unexpected = ", ".join(sorted(unexpected_keys))
        return (
            False,
            f"Unexpected key(s) in SKILL.md frontmatter: {unexpected}. Allowed properties are: {allowed}",
        )

    if "name" not in frontmatter:
        return False, "Missing 'name' in frontmatter"
    if "description" not in frontmatter:
        return False, "Missing 'description' in frontmatter"

    name = frontmatter.get("name", "")
    if not isinstance(name, str):
        return False, f"Name must be a string, got {type(name).__name__}"
    name = name.strip()
    if name:
        if not re.match(r"^[a-z0-9-]+$", name):
            return (
                False,
                f"Name '{name}' should be hyphen-case (lowercase letters, digits, and hyphens only)",
            )
        if name.startswith("-") or name.endswith("-") or "--" in name:
            return (
                False,
                f"Name '{name}' cannot start/end with hyphen or contain consecutive hyphens",
            )
        if len(name) > MAX_SKILL_NAME_LENGTH:
            return (
                False,
                f"Name is too long ({len(name)} characters). "
                f"Maximum is {MAX_SKILL_NAME_LENGTH} characters.",
            )

    description = frontmatter.get("description", "")
    if not isinstance(description, str):
        return False, f"Description must be a string, got {type(description).__name__}"
    description = description.strip()
    if description:
        if "<" in description or ">" in description:
            return False, "Description cannot contain angle brackets (< or >)"
        if len(description) > 1024:
            return (
                False,
                f"Description is too long ({len(description)} characters). Maximum is 1024 characters.",
            )

    return True, "Skill is valid!"


if __name__ == "__main__":
    if len(sys.argv) != 2:
        print("Usage: python quick_validate.py <skill_directory>")
        sys.exit(1)

    valid, message = validate_skill(sys.argv[1])
    print(message)
    sys.exit(0 if valid else 1)


path: scripts/package_skill.py
content: #!/usr/bin/env python3
"""
Skill Packager - Creates a distributable .skill file of a skill folder

Usage:
    python utils/package_skill.py <path/to/skill-folder> [output-directory]

Example:
    python utils/package_skill.py skills/public/my-skill
    python utils/package_skill.py skills/public/my-skill ./dist
"""

import sys
import zipfile
from pathlib import Path

from quick_validate import validate_skill


def _is_within(path: Path, root: Path) -> bool:
    try:
        path.relative_to(root)
        return True
    except ValueError:
        return False


def package_skill(skill_path, output_dir=None):
    """
    Package a skill folder into a .skill file.

    Args:
        skill_path: Path to the skill folder
        output_dir: Optional output directory for the .skill file (defaults to current directory)

    Returns:
        Path to the created .skill file, or None if error
    """
    skill_path = Path(skill_path).resolve()

    # Validate skill folder exists
    if not skill_path.exists():
        print(f"[ERROR] Skill folder not found: {skill_path}")
        return None

    if not skill_path.is_dir():
        print(f"[ERROR] Path is not a directory: {skill_path}")
        return None

    # Validate SKILL.md exists
    skill_md = skill_path / "SKILL.md"
    if not skill_md.exists():
        print(f"[ERROR] SKILL.md not found in {skill_path}")
        return None

    # Run validation before packaging
    print("Validating skill...")
    valid, message = validate_skill(skill_path)
    if not valid:
        print(f"[ERROR] Validation failed: {message}")
        print("   Please fix the validation errors before packaging.")
        return None
    print(f"[OK] {message}\n")

    # Determine output location
    skill_name = skill_path.name
    if output_dir:
        output_path = Path(output_dir).resolve()
        output_path.mkdir(parents=True, exist_ok=True)
    else:
        output_path = Path.cwd()

    skill_filename = output_path / f"{skill_name}.skill"

    EXCLUDED_DIRS = {".git", ".svn", ".hg", "__pycache__", "node_modules"}

    # Create the .skill file (zip format)
    try:
        with zipfile.ZipFile(skill_filename, "w", zipfile.ZIP_DEFLATED) as zipf:
            # Walk through the skill directory
            for file_path in skill_path.rglob("*"):
                # Security: never follow or package symlinks.
                if file_path.is_symlink():
                    print(f"[WARN] Skipping symlink: {file_path}")
                    continue

                rel_parts = file_path.relative_to(skill_path).parts
                if any(part in EXCLUDED_DIRS for part in rel_parts):
                    continue

                if file_path.is_file():
                    resolved_file = file_path.resolve()
                    if not _is_within(resolved_file, skill_path):
                        print(f"[ERROR] File escapes skill root: {file_path}")
                        return None
                    # If output lives under skill_path, avoid writing archive into itself.
                    if resolved_file == skill_filename.resolve():
                        print(f"[WARN] Skipping output archive: {file_path}")
                        continue

                    # Calculate the relative path within the zip.
                    arcname = Path(skill_name) / file_path.relative_to(skill_path)
                    zipf.write(file_path, arcname)
                    print(f"  Added: {arcname}")

        print(f"\n[OK] Successfully packaged skill to: {skill_filename}")
        return skill_filename

    except Exception as e:
        print(f"[ERROR] Error creating .skill file: {e}")
        return None


def main():
    if len(sys.argv) < 2:
        print("Usage: python utils/package_skill.py <path/to/skill-folder> [output-directory]")
        print("\nExample:")
        print("  python utils/package_skill.py skills/public/my-skill")
        print("  python utils/package_skill.py skills/public/my-skill ./dist")
        sys.exit(1)

    skill_path = sys.argv[1]
    output_dir = sys.argv[2] if len(sys.argv) > 2 else None

    print(f"Packaging skill: {skill_path}")
    if output_dir:
        print(f"   Output directory: {output_dir}")
    print()

    result = package_skill(skill_path, output_dir)

    if result:
        sys.exit(0)
    else:
        sys.exit(1)


if __name__ == "__main__":
    main()


path: scripts/aop/__init__.py
content: # -*- coding: utf-8 -*-
#!/usr/bin/env python

"""
Created on 2016-12-26

@author: Alibaba Open Platform

"""

import time
import datetime

from .api import GetServerTimestampRequest

class AopError(Exception):
    """
    1. Failed before sending a request.
        e.g. Some of the required API parameters missing.
    2. Failed to parse the returned results.

    """
    pass

class ApiError(Exception):
    """
    The remote server returned error and the error messages were successfully recognized.

    Attributes
    ----------
    api : str
    error_code : str
    error_message : str
    exception : str
    request_id : str

    """
    def __init__(self):
        self.api = ''
        self.error_code = ''
        self.error_message = ''
        self.exception = ''
        self.request_id = ''

    def __str__(self, *args, **kwargs):
        return 'ApiError [api=%s; error_code=%s; error_message=%s; exception=%s; request_id=%s]' % \
            (self.api, self.error_code, self.error_message, self.exception, self.request_id)

class AppInfo(object):
    def __init__(self, appkey, secret):
        self.appkey = appkey
        self.[REDACTED_SECRET]

def get_default_appinfo():
    pass

def set_default_appinfo(appkey, secret):
    """Set default appkey and secret.

    Parameters
    ----------
    appkey : int
    secret : str

    Notes
    -----
    Secret will be saved in plain text in memory.

    """
    global get_default_appinfo
    get_default_appinfo = lambda : AppInfo(appkey, secret)

def get_default_server():
    pass

def set_default_server(remote_server):
    if remote_server:
        default_server = remote_server
        global get_default_server
        get_default_server = lambda: default_server

def get_timestamp_diff(appkey, secret, server):
    """
    Returns
    -------
    int
        timestamp difference between the server and the local.

    Raises
    ------
    AopError
        First calls API '1/system/currentTimeMillis'. So it may fail due to different reasons.

    """
    return get_server_timestamp(appkey, secret, server) - get_local_timestamp()

def get_server_timestamp(appkey, secret, server):
    """
    Returns
    -------
    int
        Milliseconds since midnight, January 1, 1970 UTC. e.g. 1484033752883

    Raises
    ------
    AopError
        Actually calls API '1/system/currentTimeMillis'. So it may fail due to different reasons.

    """
    req = GetServerTimestampRequest(server)
    req.set_appinfo(appkey, secret)
    try:
        return req.get_response()
    except Exception as e:
        raise AopError('Failed to get server timestamp from %s. Reason: %s' % (server, str(e)))

def get_local_timestamp(appkey=None, secret=None, server=None):
     return int(time.time() * 1000)


def get_timestamp_generator():
    return get_local_timestamp

def set_timestamp_generator(timestamp_generator):
    """Set timestamp generator.

    Timestamp is milliseconds since midnight, January 1, 1970 UTC and needed by some APIs
    due to security concerns.

    Timestamp generator is a function taking three arguments: appkey, secret, server domain.

    Generally, there are three policy to generate the timestamp.
    1. Use the local time every time.
        This is the default policy.
        You should first check the time difference between your local machine and the server.
    2. Use the server time every time. NOT RECOMMENDED!
        Just call aop.set_timestamp_generator(aop.get_server_timestamp)
        But remember that there is a call limit for the the API per 10-minutes.
    3. Get the timestamp by the formula: local_timestamp + timestamp_diff.
        "timestamp_diff" is the time difference between the server and the local that saved
        somewhere and periodically synchronized by calling aop.get_timestamp_diff().
        e.g.
            1> periodically synchronize timestamp_diff:
                timestamp_diff = aop.get_timestamp_diff(appkey, secret, server)
            2> aop.set_timestamp_generator(lambda appkey, secret, server: timestamp_diff + aop.get_local_timestamp())

    Parameters
    ----------
        timestamp_generator : callable taking three arguments: appkey, secret, server domain.

    """
    if timestamp_generator:
        default_timestamp_generator = timestamp_generator
        global get_timestamp_generator
        get_timestamp_generator = lambda : default_timestamp_generator



path: scripts/aop/api/common/__init__.py
content: # -*- coding: utf-8 -*-
#!/usr/bin/env python

"""
Created on 2016-12-26

@author: Alibaba Open Platform

"""

# from aop.api.common.AuthGetTokenRequest import AuthGetTokenRequest
# from aop.api.common.AuthPostponeTokenRequest import AuthPostponeTokenRequest
from aop.api.common.GetServerTimestampRequest import GetServerTimestampRequest


path: scripts/aop/api/common/GetServerTimestampRequest.py
content: # -*- coding: utf-8 -*-
#!/usr/bin/env python

"""
Created on 2016-12-26

@author: Alibaba Open Platform

"""

from aop.api.base import BaseApi

class GetServerTimestampRequest(BaseApi):
    """
    Returns
    -------
    int
        Milliseconds since midnight, January 1, 1970 UTC. e.g. 1484033752883

    """
    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)

    def get_api_uri(self):
        return '1/system/currentTimeMillis'

    def need_sign(self):
        return False

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def need_https(self):
        return False

    def get_multipart_params(self):
        return []

    def get_required_params(self):
        return []

    def is_inner_api(self):
        return False


path: scripts/aop/api/__init__.py
content: # -*- coding: utf-8 -*-
#!/usr/bin/env python

"""
Created on 2016-12-26

@author: Alibaba Open Platform

"""

from aop.api.base import FileItem, BaseApi
from aop.api.common import *
from aop.api.biz import *

path: scripts/aop/api/biz/UmengApptrackGetStayTrendDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetStayTrendDataRequest(BaseApi):
    """根据用户输入计划id和单元id获取留存数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getStayTrendData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.planId = None
        self.unitId = None
        self.queryDate = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getStayTrendData'

    def get_required_params(self):
        return ['planId', 'queryDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengApptrackGetPayAnalysisDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetPayAnalysisDataRequest(BaseApi):
    """根据计划id或单元id查询出该计划id或单元id下用户拍下订单数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getPayAnalysisData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.planId = None
        self.unitId = None
        self.queryDate = None
        self.pageNum = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getPayAnalysisData'

    def get_required_params(self):
        return ['planId', 'queryDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetRetentionsRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetRetentionsRequest(BaseApi):
    """获取指定App某个时间范围内的新增用户留存率

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getRetentions&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None
        self.channel = None
        self.version = None
        self.type = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getRetentions'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetEventListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetEventListRequest(BaseApi):
    """获取自定义事件列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getEventList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getEventList'

    def get_required_params(self):
        return ['dataSourceId']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetNewAccountsRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetNewAccountsRequest(BaseApi):
    """获取新增账号（仅游戏类型app）

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getNewAccounts&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None
        self.channel = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getNewAccounts'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetAppListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetAppListRequest(BaseApi):
    """获取用户的小程序列表及数量

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getAppList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.pageIndex = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getAppList'

    def get_required_params(self):
        return []

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetMultiIndiceListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetMultiIndiceListRequest(BaseApi):
    """获取分组指标列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getMultiIndiceList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getMultiIndiceList'

    def get_required_params(self):
        return ['dataSourceId']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetChannelOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetChannelOverviewRequest(BaseApi):
    """获取某推广渠道的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getChannelOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.fromDate = None
        self.toDate = None
        self.channel = None
        self.timeUnit = None
        self.dataSourceId = None
        self.indicators = None
        self.pageIndex = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getChannelOverview'

    def get_required_params(self):
        return ['fromDate', 'toDate', 'channel', 'timeUnit', 'dataSourceId', 'indicators']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetTotalUserRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetTotalUserRequest(BaseApi):
    """获取应用的累计用户数

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getTotalUser&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.fromDate = None
        self.toDate = None
        self.pageIndex = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getTotalUser'

    def get_required_params(self):
        return ['dataSourceId', 'fromDate', 'toDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappEventGetUniqueUsersRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappEventGetUniqueUsersRequest(BaseApi):
    """获取自定义事件的独立用户数统计数据（按设备device统计 "data":[{"data":[123],"dates":["2018-01-01"]}）

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.event.getUniqueUsers&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.eventName = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.event.getUniqueUsers'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate', 'eventName']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetAllPropertyValueCountRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetAllPropertyValueCountRequest(BaseApi):
    """获取某事件属性下全部属性值数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getAllPropertyValueCount&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.timeUnit = None
        self.fromDate = None
        self.toDate = None
        self.propertyName = None
        self.pageIndex = None
        self.pageSize = None
        self.eventName = None
        self.dataSourceId = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getAllPropertyValueCount'

    def get_required_params(self):
        return ['timeUnit', 'fromDate', 'toDate', 'propertyName', 'eventName', 'dataSourceId']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetChannelDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetChannelDataRequest(BaseApi):
    """获取指定App按照分发渠道维度的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getChannelData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.date = None
        self.perPage = None
        self.page = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getChannelData'

    def get_required_params(self):
        return ['appkey', 'date']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetMultiOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetMultiOverviewRequest(BaseApi):
    """获取分组指标数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getMultiOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.isv = None
        self.fromDate = None
        self.toDate = None
        self.timeUnit = None
        self.groupName = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getMultiOverview'

    def get_required_params(self):
        return ['dataSourceId', 'isv', 'fromDate', 'toDate', 'timeUnit', 'groupName']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetNewUsersRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetNewUsersRequest(BaseApi):
    """获取指定App某个时间范围内的新增用户数

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getNewUsers&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getNewUsers'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/__init__.py
content: from aop.api.biz.UmengApptrackBackReportDataRequest import UmengApptrackBackReportDataRequest
from aop.api.biz.UmengApptrackGetActiveDetailDataRequest import UmengApptrackGetActiveDetailDataRequest
from aop.api.biz.UmengApptrackGetPayAnalysisDataRequest import UmengApptrackGetPayAnalysisDataRequest
from aop.api.biz.UmengApptrackGetOrderAnalysisDataRequest import UmengApptrackGetOrderAnalysisDataRequest
from aop.api.biz.UmengApptrackGetRegisterAnalysisDataRequest import UmengApptrackGetRegisterAnalysisDataRequest
from aop.api.biz.UmengApptrackGetMonitoringListRequest import UmengApptrackGetMonitoringListRequest
from aop.api.biz.UmengApptrackGetClickActiveDataRequest import UmengApptrackGetClickActiveDataRequest
from aop.api.biz.UmengApptrackGetStayTrendDataRequest import UmengApptrackGetStayTrendDataRequest
from aop.api.biz.UmengApptrackGetPlanListRequest import UmengApptrackGetPlanListRequest
from aop.api.biz.UmengApptrackGetMyEventDataRequest import UmengApptrackGetMyEventDataRequest
from aop.api.biz.UmengApptrackGetRegisterLoginDataRequest import UmengApptrackGetRegisterLoginDataRequest
from aop.api.biz.UmengUappCreateAppRequest import UmengUappCreateAppRequest
from aop.api.biz.UmengUappGetNewAccountsRequest import UmengUappGetNewAccountsRequest
from aop.api.biz.UmengUappGetActiveAccountsRequest import UmengUappGetActiveAccountsRequest
from aop.api.biz.UmengUappGetLaunchesByChannelOrVersionRequest import UmengUappGetLaunchesByChannelOrVersionRequest
from aop.api.biz.UmengUappEventCreateRequest import UmengUappEventCreateRequest
from aop.api.biz.UmengUappGetActiveUsersByChannelOrVersionRequest import UmengUappGetActiveUsersByChannelOrVersionRequest
from aop.api.biz.UmengUappGetNewUsersByChannelOrVersionRequest import UmengUappGetNewUsersByChannelOrVersionRequest
from aop.api.biz.UmengUappEventParamGetValueDurationListRequest import UmengUappEventParamGetValueDurationListRequest
from aop.api.biz.UmengUappGetTodayYesterdayDataRequest import UmengUappGetTodayYesterdayDataRequest
from aop.api.biz.UmengUappGetYesterdayDataRequest import UmengUappGetYesterdayDataRequest
from aop.api.biz.UmengUappGetTodayDataRequest import UmengUappGetTodayDataRequest
from aop.api.biz.UmengUappEventGetUniqueUsersRequest import UmengUappEventGetUniqueUsersRequest
from aop.api.biz.UmengUappGetAllAppDataRequest import UmengUappGetAllAppDataRequest
from aop.api.biz.UmengUappGetAppCountRequest import UmengUappGetAppCountRequest
from aop.api.biz.UmengUappGetChannelDataRequest import UmengUappGetChannelDataRequest
from aop.api.biz.UmengUappGetVersionDataRequest import UmengUappGetVersionDataRequest
from aop.api.biz.UmengUappEventParamGetDataRequest import UmengUappEventParamGetDataRequest
from aop.api.biz.UmengUappEventParamGetValueListRequest import UmengUappEventParamGetValueListRequest
from aop.api.biz.UmengUappEventGetDataRequest import UmengUappEventGetDataRequest
from aop.api.biz.UmengUappEventParamListRequest import UmengUappEventParamListRequest
from aop.api.biz.UmengUappEventListRequest import UmengUappEventListRequest
from aop.api.biz.UmengUappGetRetentionsRequest import UmengUappGetRetentionsRequest
from aop.api.biz.UmengUappGetDurationsRequest import UmengUappGetDurationsRequest
from aop.api.biz.UmengUappGetLaunchesRequest import UmengUappGetLaunchesRequest
from aop.api.biz.UmengUappGetActiveUsersRequest import UmengUappGetActiveUsersRequest
from aop.api.biz.UmengUappGetNewUsersRequest import UmengUappGetNewUsersRequest
from aop.api.biz.UmengUappGetDailyDataRequest import UmengUappGetDailyDataRequest
from aop.api.biz.UmengUappGetAppListRequest import UmengUappGetAppListRequest
from aop.api.biz.UmengUminiGetCustomerSourceOverviewRequest import UmengUminiGetCustomerSourceOverviewRequest
from aop.api.biz.UmengUminiGetMultiIndiceListRequest import UmengUminiGetMultiIndiceListRequest
from aop.api.biz.UmengUminiGetMultiOverviewRequest import UmengUminiGetMultiOverviewRequest
from aop.api.biz.UmengUminiInitMultiLevelTreeRequest import UmengUminiInitMultiLevelTreeRequest
from aop.api.biz.UmengUminiGetSceneInfoListRequest import UmengUminiGetSceneInfoListRequest
from aop.api.biz.UmengUminiGetRetentionByDataSourceIdRequest import UmengUminiGetRetentionByDataSourceIdRequest
from aop.api.biz.UmengUminiGetMultiLevelTreeRequest import UmengUminiGetMultiLevelTreeRequest
from aop.api.biz.UmengUminiGetLandingPageListRequest import UmengUminiGetLandingPageListRequest
from aop.api.biz.UmengUminiGetShareUserListRequest import UmengUminiGetShareUserListRequest
from aop.api.biz.UmengUminiGetVisitPageListRequest import UmengUminiGetVisitPageListRequest
from aop.api.biz.UmengUminiEditPathDisplayNameRequest import UmengUminiEditPathDisplayNameRequest
from aop.api.biz.UmengUminiBatchCreateEventRequest import UmengUminiBatchCreateEventRequest
from aop.api.biz.UmengUminiEditMiniAppRequest import UmengUminiEditMiniAppRequest
from aop.api.biz.UmengUminiGetShareOverviewRequest import UmengUminiGetShareOverviewRequest
from aop.api.biz.UmengUminiGetSharePageOverviewRequest import UmengUminiGetSharePageOverviewRequest
from aop.api.biz.UmengUminiGetAllPropertyValueCountRequest import UmengUminiGetAllPropertyValueCountRequest
from aop.api.biz.UmengUminiGetEventOverviewRequest import UmengUminiGetEventOverviewRequest
from aop.api.biz.UmengUminiGetEventProvertyListRequest import UmengUminiGetEventProvertyListRequest
from aop.api.biz.UmengUminiGetEventListRequest import UmengUminiGetEventListRequest
from aop.api.biz.UmengUminiGetChannelOverviewRequest import UmengUminiGetChannelOverviewRequest
from aop.api.biz.UmengUminiGetCampaignOverviewRequest import UmengUminiGetCampaignOverviewRequest
from aop.api.biz.UmengUminiGetSceneOverviewRequest import UmengUminiGetSceneOverviewRequest
from aop.api.biz.UmengUminiGetAppListRequest import UmengUminiGetAppListRequest
from aop.api.biz.UmengUminiCreateMiniAppRequest import UmengUminiCreateMiniAppRequest
from aop.api.biz.UmengUminiGetOverviewRequest import UmengUminiGetOverviewRequest
from aop.api.biz.UmengUminiGetTotalUserRequest import UmengUminiGetTotalUserRequest


path: scripts/aop/api/biz/UmengUminiGetSharePageOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetSharePageOverviewRequest(BaseApi):
    """获取页面分享概况数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getSharePageOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.fromDate = None
        self.toDate = None
        self.timeUnit = None
        self.pageIndex = None
        self.pageSize = None
        self.orderBy = None
        self.direction = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getSharePageOverview'

    def get_required_params(self):
        return ['dataSourceId', 'fromDate', 'toDate', 'timeUnit']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetShareOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetShareOverviewRequest(BaseApi):
    """获取小程序某天的分享数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getShareOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.fromDate = None
        self.toDate = None
        self.timeUnit = None
        self.pageIndex = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getShareOverview'

    def get_required_params(self):
        return ['dataSourceId', 'fromDate', 'toDate', 'timeUnit']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetLandingPageListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetLandingPageListRequest(BaseApi):
    """获取页面分析-入口页面列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getLandingPageList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.timeUnit = None
        self.fromDate = None
        self.toDate = None
        self.orderBy = None
        self.direction = None
        self.pageIndex = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getLandingPageList'

    def get_required_params(self):
        return ['dataSourceId', 'timeUnit', 'fromDate', 'toDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetShareUserListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetShareUserListRequest(BaseApi):
    """获取分享用户列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getShareUserList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.timeUnit = None
        self.fromDate = None
        self.toDate = None
        self.orderBy = None
        self.direction = None
        self.pageIndex = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getShareUserList'

    def get_required_params(self):
        return ['dataSourceId', 'timeUnit', 'fromDate', 'toDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetCampaignOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetCampaignOverviewRequest(BaseApi):
    """获取某推广活动的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getCampaignOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.timeUnit = None
        self.fromDate = None
        self.toDate = None
        self.campaign = None
        self.pageSize = None
        self.pageIndex = None
        self.dataSourceId = None
        self.indicators = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getCampaignOverview'

    def get_required_params(self):
        return ['timeUnit', 'fromDate', 'toDate', 'campaign', 'dataSourceId', 'indicators']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengApptrackGetActiveDetailDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetActiveDetailDataRequest(BaseApi):
    """此接口限定pro用户使用，根据用户输入appKey和计划id，queryDate，返回激活设备明细数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getActiveDetailData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appKey = None
        self.planId = None
        self.queryDate = None
        self.pageNum = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getActiveDetailData'

    def get_required_params(self):
        return ['appKey', 'queryDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetEventProvertyListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetEventProvertyListRequest(BaseApi):
    """获取某自定义事件的属性列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getEventProvertyList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.eventName = None
        self.dataSourceId = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getEventProvertyList'

    def get_required_params(self):
        return ['eventName', 'dataSourceId']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetRetentionByDataSourceIdRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetRetentionByDataSourceIdRequest(BaseApi):
    """获取应用的留存数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getRetentionByDataSourceId&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.fromDate = None
        self.toDate = None
        self.timeUnit = None
        self.pageIndex = None
        self.pageSize = None
        self.indicator = None
        self.valueType = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getRetentionByDataSourceId'

    def get_required_params(self):
        return ['dataSourceId', 'fromDate', 'toDate', 'timeUnit', 'valueType']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiCreateMiniAppRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiCreateMiniAppRequest(BaseApi):
    """新建小程序数据源

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.createMiniApp&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.name = None
        self.type = None
        self.platform = None
        self.language = None
        self.firstLevel = None
        self.secondLevel = None
        self.description = None
        self.miniAppId = None
        self.miniAppSecret = None
        self.miniPublicKey = None
        self.miniPrivateKey = None
        self.integrationType = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.createMiniApp'

    def get_required_params(self):
        return ['name', 'type', 'platform', 'language', 'firstLevel', 'secondLevel']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetAllAppDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetAllAppDataRequest(BaseApi):
    """获取当前用户所有App昨日和今日的基础统计数据（活跃用户数，新增用户数，启动次数，总用户数）

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getAllAppData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getAllAppData'

    def get_required_params(self):
        return []

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetNewUsersByChannelOrVersionRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetNewUsersByChannelOrVersionRequest(BaseApi):
    """根据渠道或版本条件，获取指定App某个时间范围内的新增用户数

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getNewUsersByChannelOrVersion&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None
        self.channels = None
        self.versions = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getNewUsersByChannelOrVersion'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate', 'periodType']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetTodayDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetTodayDataRequest(BaseApi):
    """获取指定App今日的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getTodayData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getTodayData'

    def get_required_params(self):
        return ['appkey']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappEventGetDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappEventGetDataRequest(BaseApi):
    """获取自定义事件事件的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.event.getData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.eventName = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.event.getData'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate', 'eventName']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetYesterdayDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetYesterdayDataRequest(BaseApi):
    """获取指定App昨日的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getYesterdayData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getYesterdayData'

    def get_required_params(self):
        return ['appkey']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengApptrackGetClickActiveDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetClickActiveDataRequest(BaseApi):
    """根据计划id或单元id查询出该计划id或单元id下的点击激活数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getClickActiveData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.planId = None
        self.unitId = None
        self.queryDate = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getClickActiveData'

    def get_required_params(self):
        return ['planId', 'queryDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetActiveUsersRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetActiveUsersRequest(BaseApi):
    """获取指定App某个时间范围内的活跃用户数

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getActiveUsers&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getActiveUsers'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiBatchCreateEventRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiBatchCreateEventRequest(BaseApi):
    """批量创建事件

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.batchCreateEvent&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.eventList = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.batchCreateEvent'

    def get_required_params(self):
        return ['dataSourceId', 'eventList']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengApptrackBackReportDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackBackReportDataRequest(BaseApi):
    """为众盟定制开发的投放报表数据回传接口

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.backReportData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.reportList = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.backReportData'

    def get_required_params(self):
        return ['reportList']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappCreateAppRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappCreateAppRequest(BaseApi):
    """U-App新建数据源

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.createApp&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.name = None
        self.type = None
        self.platform = None
        self.language = None
        self.firstLevel = None
        self.secondLevel = None
        self.description = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.createApp'

    def get_required_params(self):
        return ['name', 'type', 'platform', 'language', 'firstLevel', 'secondLevel']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetAppCountRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetAppCountRequest(BaseApi):
    """获取当前用户所有App的数量

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getAppCount&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getAppCount'

    def get_required_params(self):
        return []

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengApptrackGetRegisterLoginDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetRegisterLoginDataRequest(BaseApi):
    """根据计划id或单元id查询出该计划id或单元id下的注册登录等相关数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getRegisterLoginData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.planId = None
        self.unitId = None
        self.queryDate = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getRegisterLoginData'

    def get_required_params(self):
        return ['planId', 'queryDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetLaunchesByChannelOrVersionRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetLaunchesByChannelOrVersionRequest(BaseApi):
    """根据渠道或版本条件，获取指定App某个时间范围内的启动次数

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getLaunchesByChannelOrVersion&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None
        self.channels = None
        self.versions = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getLaunchesByChannelOrVersion'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate', 'periodType']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappEventListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappEventListRequest(BaseApi):
    """获取自定义事件列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.event.list&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.perPage = None
        self.page = None
        self.version = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.event.list'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiEditPathDisplayNameRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiEditPathDisplayNameRequest(BaseApi):
    """编辑页面路径显示名称

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.editPathDisplayName&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.displayName = None
        self.path = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.editPathDisplayName'

    def get_required_params(self):
        return ['dataSourceId', 'displayName', 'path']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetLaunchesRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetLaunchesRequest(BaseApi):
    """获取指定App某个时间范围内的启动次数

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getLaunches&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getLaunches'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengApptrackGetRegisterAnalysisDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetRegisterAnalysisDataRequest(BaseApi):
    """根据计划id或单元id查询出该计划id或单元id下用户注册事件数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getRegisterAnalysisData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.planId = None
        self.unitId = None
        self.queryDate = None
        self.pageNum = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getRegisterAnalysisData'

    def get_required_params(self):
        return ['planId', 'queryDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengApptrackGetMonitoringListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetMonitoringListRequest(BaseApi):
    """根据用户输入的计划id返回该计划id下的监测单元id

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getMonitoringList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.planId = None
        self.pageNum = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getMonitoringList'

    def get_required_params(self):
        return ['planId']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappEventParamListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappEventParamListRequest(BaseApi):
    """获取自定义事件的参数列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.event.param.list&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.startDate = None
        self.endDate = None
        self.eventId = None
        self.appkey = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.event.param.list'

    def get_required_params(self):
        return ['startDate', 'endDate', 'eventId', 'appkey']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetVisitPageListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetVisitPageListRequest(BaseApi):
    """获取页面分析-受访页面列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getVisitPageList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.timeUnit = None
        self.fromDate = None
        self.toDate = None
        self.orderBy = None
        self.direction = None
        self.pageIndex = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getVisitPageList'

    def get_required_params(self):
        return ['dataSourceId', 'timeUnit', 'fromDate', 'toDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetAppListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetAppListRequest(BaseApi):
    """获取当前用户的所有App列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getAppList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.page = None
        self.perPage = None
        self.accessToken = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getAppList'

    def get_required_params(self):
        return []

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengApptrackGetOrderAnalysisDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetOrderAnalysisDataRequest(BaseApi):
    """根据计划id或单元id查询出该计划id或单元id下用户拍下订单数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getOrderAnalysisData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.planId = None
        self.unitId = None
        self.queryDate = None
        self.pageNum = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getOrderAnalysisData'

    def get_required_params(self):
        return ['planId', 'queryDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetActiveAccountsRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetActiveAccountsRequest(BaseApi):
    """获取活跃账号（仅游戏类型app）

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getActiveAccounts&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None
        self.channel = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getActiveAccounts'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetMultiLevelTreeRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetMultiLevelTreeRequest(BaseApi):
    """获取层级分组结构

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getMultiLevelTree&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getMultiLevelTree'

    def get_required_params(self):
        return ['dataSourceId']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiEditMiniAppRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiEditMiniAppRequest(BaseApi):
    """编辑小程序数据源

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.editMiniApp&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.platform = None
        self.name = None
        self.language = None
        self.firstLevel = None
        self.secondLevel = None
        self.description = None
        self.miniAppId = None
        self.miniAppSecret = None
        self.miniPublicKey = None
        self.miniPrivateKey = None
        self.integrationType = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.editMiniApp'

    def get_required_params(self):
        return ['dataSourceId']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetSceneOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetSceneOverviewRequest(BaseApi):
    """获取某场景值的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getSceneOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.timeUnit = None
        self.fromDate = None
        self.toDate = None
        self.scene = None
        self.pageIndex = None
        self.pageSize = None
        self.dataSourceId = None
        self.indicators = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getSceneOverview'

    def get_required_params(self):
        return ['timeUnit', 'fromDate', 'toDate', 'scene', 'dataSourceId', 'indicators']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetEventOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetEventOverviewRequest(BaseApi):
    """获取某自定义事件统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getEventOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.timeUnit = None
        self.fromDate = None
        self.toDate = None
        self.eventName = None
        self.dataSourceId = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getEventOverview'

    def get_required_params(self):
        return ['timeUnit', 'fromDate', 'toDate', 'eventName', 'dataSourceId']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetDailyDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetDailyDataRequest(BaseApi):
    """获取指定App特定日期的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getDailyData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.date = None
        self.version = None
        self.channel = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getDailyData'

    def get_required_params(self):
        return ['appkey', 'date']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappEventParamGetValueDurationListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappEventParamGetValueDurationListRequest(BaseApi):
    """根据自定义事件参数值，获取使用时长

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.event.param.getValueDurationList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.eventName = None
        self.eventParamName = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.event.param.getValueDurationList'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate', 'eventName', 'eventParamName']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetTodayYesterdayDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetTodayYesterdayDataRequest(BaseApi):
    """获取指定App今天与昨天的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getTodayYesterdayData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getTodayYesterdayData'

    def get_required_params(self):
        return ['appkey']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetCustomerSourceOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetCustomerSourceOverviewRequest(BaseApi):
    """获取-获客来源的指标数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getCustomerSourceOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.sourceType = None
        self.fromDate = None
        self.toDate = None
        self.timeUnit = None
        self.orderBy = None
        self.direction = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getCustomerSourceOverview'

    def get_required_params(self):
        return ['dataSourceId', 'sourceType', 'fromDate', 'toDate', 'timeUnit']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetActiveUsersByChannelOrVersionRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetActiveUsersByChannelOrVersionRequest(BaseApi):
    """根据渠道或版本条件，获取指定App某个时间范围内的活跃用户数

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getActiveUsersByChannelOrVersion&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None
        self.channels = None
        self.versions = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getActiveUsersByChannelOrVersion'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate', 'periodType']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengApptrackGetPlanListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetPlanListRequest(BaseApi):
    """根据用户id获得用户计划列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getPlanList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appKey = None
        self.pageNum = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getPlanList'

    def get_required_params(self):
        return []

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetDurationsRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetDurationsRequest(BaseApi):
    """获取指定App某个时间范围内的使用时长统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getDurations&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.date = None
        self.statType = None
        self.channel = None
        self.version = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getDurations'

    def get_required_params(self):
        return ['appkey', 'date']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappEventParamGetDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappEventParamGetDataRequest(BaseApi):
    """获取自定义事件某个参数按照值维度的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.event.param.getData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.eventName = None
        self.eventParamName = None
        self.paramValueName = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.event.param.getData'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate', 'eventName', 'eventParamName', 'paramValueName']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappGetVersionDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetVersionDataRequest(BaseApi):
    """获取指定App按照版本维度的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getVersionData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.date = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getVersionData'

    def get_required_params(self):
        return ['appkey', 'date']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetSceneInfoListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetSceneInfoListRequest(BaseApi):
    """获取渠道或活动信息列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getSceneInfoList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.sourceType = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getSceneInfoList'

    def get_required_params(self):
        return ['dataSourceId', 'sourceType']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappEventParamGetValueListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappEventParamGetValueListRequest(BaseApi):
    """获取自定义事件某个参数的取值范围列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.event.param.getValueList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.eventName = None
        self.eventParamName = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.event.param.getValueList'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate', 'eventName', 'eventParamName']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUappEventCreateRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappEventCreateRequest(BaseApi):
    """创建自定义事件

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.event.create&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.eventName = None
        self.eventDisplayName = None
        self.eventType = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.event.create'

    def get_required_params(self):
        return ['appkey', 'eventName', 'eventDisplayName']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiGetOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetOverviewRequest(BaseApi):
    """获取应用概况数据：启动、活跃、新增、访次、次均停留时长、人均停留时长

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.fromDate = None
        self.toDate = None
        self.timeUnit = None
        self.indicators = None
        self.pageIndex = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getOverview'

    def get_required_params(self):
        return ['dataSourceId', 'fromDate', 'toDate', 'timeUnit', 'indicators']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengApptrackGetMyEventDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetMyEventDataRequest(BaseApi):
    """根据用户输入的计划id或者监测单元id返回用户自定义事件数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getMyEventData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.planId = None
        self.unitId = None
        self.queryDate = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getMyEventData'

    def get_required_params(self):
        return ['planId', 'queryDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: scripts/aop/api/biz/UmengUminiInitMultiLevelTreeRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiInitMultiLevelTreeRequest(BaseApi):
    """上传层级分组结构

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.initMultiLevelTree&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.treeJson = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.initMultiLevelTree'

    def get_required_params(self):
        return ['dataSourceId', 'treeJson']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: scripts/aop/api/base.py
content: # -*- coding: utf-8 -*-
#!/usr/bin/env python

"""
Created on 2016-12-26

@author: Alibaba Open Platform

"""

import sys
import hmac
import hashlib
import requests
try:
    import simplejson as json
except (ImportError, SyntaxError):
    import json

import aop

PY3 = sys.version_info >= (3,)

# constants
P_OPENAPI = 'openapi'
P_API = 'api'
P_PARAM2 = 'param2'

# system parameters
P_ACCESS_TOKEN = 'access_token'
P_TIMESTAMP = '_aop_timestamp'
P_SIGN = '_aop_signature'

P_ERROR_CODE = 'error_code'
P_ERROR_MESSAGE = 'error_message'
P_EXCEPTION = 'exception'
P_REQUEST_ID = 'request_id'

P_SYS_PARAMS =[P_TIMESTAMP, P_SIGN, P_ACCESS_TOKEN]

def is_sys_param(param_name):
    return param_name in P_SYS_PARAMS

def mix_str(pstr):
    if isinstance(pstr, str):
        return pstr
    if not PY3 and isinstance(pstr, unicode):
        return pstr.encode('utf-8')
    else:
        return str(pstr)


###############################################################################
class FileItem(object):
    def __init__(self, filename=None, content=None):
        """
        Parameters
        ----------
        content : file-like-object(str/bytes/bytearray or an object that has read attribute)
            e.g. f = open('filepath', 'rb') ... fileitem = aop.api.FileItem('filename', f)
            e.g. fileitem = aop.api.FileItem('filename', 'file_content_str')

        """
        self.filename = filename
        self.content = content

class BaseApi(object):
    """"Base class of APIs.

    """

    def raise_aop_error(self, *args):
        _args = ['API: ' + self.get_api_uri()]
        if args:
            _args.extend(args)
        raise aop.AopError(*_args)

    def __init__(self, domain=None):
        """

        Parameters
        ----------
        domain : str
            Remote server domain. e.g. 'gw.open.1688.com' for 1688.

        """
        self.__domain = domain
        if not self.__domain and aop.get_default_server():
            self.__domain = aop.get_default_server()
        self.__httpmethod = "POST"
        default_appinfo = aop.get_default_appinfo()
        if default_appinfo:
            self.__appkey = default_appinfo.appkey
            self.__secret = default_appinfo.secret
        else:
            self.__appkey = ''
            self.__secret = ''
        self.__need_https = True

    def sign(self, urlPath, params, secret):
        """Method to generate _aop_signature.

        Parameters
        ----------
        urlPath : str
            param2/version/namespace/name/appkey
        params : dict-like
        secret : str

        References
        ----------
        https://open.1688.com/api/sysSignature.htm

        """
        if not urlPath:
            self.raise_aop_error('sign error: urlPath missing')
        if not [REDACTED_SECRET]'sign error: secret missing')
        paramList = []
        if params:
            if not hasattr(params, "items"):
                self.raise_aop_error('sign error: params must be dict-like')
            paramList = [mix_str(k) + mix_str(v) for k, v in params.items()]
            paramList = sorted(paramList)

        msg = bytearray(urlPath.encode('utf-8'))
        for param in paramList:
            msg.extend(bytes(param.encode('utf-8')))

        sha = hmac.new(bytes(secret.encode('utf-8')), None, hashlib.sha1)
        sha.update(msg)
        return sha.hexdigest().upper()

    def set_timestamp(self, timestamp):
        self._aop_timestamp = timestamp

    def set_need_https(self, need_https):
        self.__need_https = need_https

    def set_accesstoken(self, access_token):
        self.access_token = access_token

    def set_appinfo(self, appkey, secret):
        if appkey and [REDACTED_SECRET] = appkey
            self.__secret = secret

#################### Methods to implement by subclasses, begin
    def get_api_uri(self):
        """
        Returns
        -------
        str
            version/namespace/name
        """
        return ''

    def need_sign(self):
        """True if _aop_signature is needed"""
        return False

    def need_timestamp(self):
        """True if _aop_timestamp is needed"""
        return False

    def need_auth(self):
        """True if access_token is needed"""
        return False

    def need_https(self):
        """True if to send a https request"""
        return self.__need_https

    def is_inner_api(self):
        """True if not an open api. Usually false."""
        return False

    def get_multipart_params(self):
        """
        Returns
        -------
        list
            API parameters with type of byte[].
            A multipart request will be sent if not empty.
            e.g. returns ['image'] if the 'image' parameter's type is byte[].
                Then assign it as req.image = aop.api.FileItem('imagename.png', imagecontent)

        """
        return []

    def get_required_params(self):
        """
        Names of required API parameters.
        System parameters(access_token/_aop_timestamp/_aop_signature) excluded.

        An AopError with message 'Required params missing: {"missing_param1_name", ...}'
        will be thrown out if some of the required API parameters are missing before a
        request sent to the remote server.

        """
        return []
#################### Methods to implement by subclass, end

    def __get_url_protocol(self):
        return 'https' if self.need_https() else 'http'

    def _build_sign_url_path(self):
        return '%s/%s/%s' % (P_PARAM2, self.get_api_uri(), self.__appkey)

    def _build_url(self, sign_url_path):
        return '%s://%s/%s/%s' % (self.__get_url_protocol(), self.__domain,
                                  P_API if self.is_inner_api() else P_OPENAPI, sign_url_path)

    def _check_sign(self):
        if self.need_sign():
            if not self.__appkey:
                self.raise_aop_error('AppKey missing')
            if not self.__secret:
                self.raise_aop_error('App secret missing')

    def _check_auth(self, **kwargs):
        if self.need_auth():
            if not kwargs.get(P_ACCESS_TOKEN):
                self.raise_aop_error('access_token missing')

    def _check_required_params(self, **kwargs):
        missing_params = set(self.get_required_params()) - set(kwargs.keys())
        if missing_params:
            self.raise_aop_error('Required params missing: %s' % (str(missing_params)))

    def _gen_timestamp(self, server):
        timestamp_generator = aop.get_timestamp_generator()
        if not timestamp_generator:
            timestamp_generator = aop.get_local_timestamp
        try:
            return timestamp_generator(self.__appkey, self.__secret, server)
        except Exception as e:
            self.raise_aop_error('Failed to generate timestamp. Error: ' + str(e))

    def _check_server(self):
        if not self.__domain:
            if aop.get_default_server():
                self.__domain = aop.get_default_server()
            else:
                self.raise_aop_error('Remote server domain not set')

    def get_response(self, timeout=None, **kwargs):
        self._check_server()

        params = self._get_nonnull_biz_params()
        if kwargs:
            params.update(kwargs)

        if self.need_sign():
            self._check_sign()
        # if self.need_auth():
        #     self._check_auth(**params)
        if self.get_required_params():
            self._check_required_params(**params)
        if self.need_timestamp() and (not params.get(P_TIMESTAMP)):
                params[P_TIMESTAMP] = self._gen_timestamp(self.__domain)

        for multipart_param in self.get_multipart_params():
            params.pop(multipart_param)

        sign_url_path = self._build_sign_url_path()
        if self.need_sign() and (not params.get(P_SIGN)):
            params[P_SIGN] = self.sign(sign_url_path, params, self.__secret)

        url = self._build_url(sign_url_path)
        headers = self._get_request_header();

        files = {}
        if self.get_multipart_params():
            for key in self.get_multipart_params():
                fileitem = getattr(self, key)
                if(fileitem and isinstance(fileitem, FileItem)):
                    files[key] = (fileitem.filename, fileitem.content)
                else:
                    self.raise_aop_error(key + ' not a FileItem')

        resp = self._do_request(url, params, files, headers=headers, timeout=timeout);

        failed = not (resp.status_code >= 200 and resp.status_code < 400)
        ret = resp.text

        try:
            ret = json.loads(ret)
        except Exception as e:
                if failed:
                    self.raise_aop_error('API call error. status_code:%s response:%s' % (str(resp.status_code), str(ret)))
                else:
                    self.raise_aop_error('API call seemed to go ok. But we failed to read the json data. status_code:%s response:%s' % (str(resp.status_code), str(ret)))

        if failed:
            error = aop.ApiError()
            error.api = self.get_api_uri()
            if hasattr(ret, 'get'):
                error.error_code = ret.get(P_ERROR_CODE)
                error.error_message = ret.get(P_ERROR_MESSAGE)
                error.exception = ret.get(P_EXCEPTION)
                error.request_id = ret.get(P_REQUEST_ID)
            raise error

        return ret

    def _do_request(self, url, data=None, files=None, **kwargs):
        try:
            if files:
                return requests.post(url, data=data, files=files, **kwargs)
            else:
                return requests.post(url, data=data, **kwargs)
        except requests.RequestException as e:
                self.raise_aop_error(str(e))

    def _get_request_header(self):
        return {
                 'Cache-Control': 'no-cache',
                 'Connection': 'Keep-Alive',
                 'User-Agent':'Ocean-SDK-Client'
        }

    def _is_nonnull_biz_param(self, param_name, param_value):
        if is_sys_param(param_name):
            return True
        return (not param_name.startswith("__")) \
            and (not param_name.startswith("_BaseApi__")) \
            and param_value

    def _get_nonnull_biz_params(self):
        biz_params = {}
        for key, value in self.__dict__.items():
            if self._is_nonnull_biz_param(key, value):
                biz_params[key] = value
        return biz_params



path: scripts/README.md
content: Requirements
------------
python(>=2.7)
requests


Examples
--------
test.py

path: aop/__init__.py
content: # -*- coding: utf-8 -*-
#!/usr/bin/env python

"""
Created on 2016-12-26

@author: Alibaba Open Platform

"""

import time
import datetime
import os
import json
from pathlib import Path

from .api import GetServerTimestampRequest


def _load_umeng_config():
    """
    从 umeng-config.json 加载配置
    
    搜索顺序：
    1. 当前工作目录
    2. 用户主目录
    3. 技能目录
    
    Returns:
        dict: 配置信息，包含 apiKey 和 apiSecurity，如果不存在则返回 None
    """
    config_paths = [
        Path.cwd() / 'umeng-config.json',
        Path.home() / 'umeng-config.json',
        Path(__file__).parent.parent / 'umeng-config.json',
    ]
    
    for config_path in config_paths:
        if config_path.exists():
            try:
                with open(config_path, 'r', encoding='utf-8') as f:
                    config = json.load(f)
                [REDACTED_SECRET]'apiKey') or config.get('api_key') or config.get('UMENG_API_KEY')
                api_security = config.get('apiSecurity') or config.get('api_security') or config.get('UMENG_API_SECURITY')
                if api_key and api_security:
                    return {'apiKey': api_key, 'apiSecurity': api_security}
            except Exception:
                pass
    
    return None


def _get_credentials_from_env():
    """从环境变量获取认证信息"""
    [REDACTED_SECRET]"UMENG_API_KEY")
    api_security = os.getenv("UMENG_API_SECURITY")
    if api_key and api_security:
        return {'apiKey': api_key, 'apiSecurity': api_security}
    return None

class AopError(Exception):
    """
    1. Failed before sending a request.
        e.g. Some of the required API parameters missing.
    2. Failed to parse the returned results.

    """
    pass

class ApiError(Exception):
    """
    The remote server returned error and the error messages were successfully recognized.

    Attributes
    ----------
    api : str
    error_code : str
    error_message : str
    exception : str
    request_id : str

    """
    def __init__(self):
        self.api = ''
        self.error_code = ''
        self.error_message = ''
        self.exception = ''
        self.request_id = ''

    def __str__(self, *args, **kwargs):
        return 'ApiError [api=%s; error_code=%s; error_message=%s; exception=%s; request_id=%s]' % \
            (self.api, self.error_code, self.error_message, self.exception, self.request_id)

class AppInfo(object):
    def __init__(self, appkey, secret):
        self.appkey = appkey
        self.[REDACTED_SECRET]

def get_default_appinfo():
    """
    获取默认的 AppInfo
    
    优先级顺序：
    1. 已设置的默认值（通过 set_default_appinfo）
    2. umeng-config.json 配置文件
    3. 环境变量（UMENG_API_KEY, UMENG_API_SECURITY）
    
    Returns:
        AppInfo: 应用信息对象，如果未找到认证信息则返回 None
    """
    # 检查是否已设置默认值
    if hasattr(get_default_appinfo, '_appinfo') and get_default_appinfo._appinfo:
        return get_default_appinfo._appinfo
    
    # 尝试从配置文件加载
    config = _load_umeng_config()
    if config:
        appinfo = AppInfo(config['apiKey'], config['apiSecurity'])
        get_default_appinfo._appinfo = appinfo
        return appinfo
    
    # 尝试从环境变量加载
    env_creds = _get_credentials_from_env()
    if env_creds:
        appinfo = AppInfo(env_creds['apiKey'], env_creds['apiSecurity'])
        get_default_appinfo._appinfo = appinfo
        return appinfo
    
    return None


def set_default_appinfo(appkey, secret):
    """Set default appkey and secret.

    Parameters
    ----------
    appkey : int
    secret : str

    Notes
    -----
    Secret will be saved in plain text in memory.

    """
    global get_default_appinfo
    get_default_appinfo._appinfo = AppInfo(appkey, secret)

def get_default_server():
    pass

def set_default_server(remote_server):
    if remote_server:
        default_server = remote_server
        global get_default_server
        get_default_server = lambda: default_server

def get_timestamp_diff(appkey, secret, server):
    """
    Returns
    -------
    int
        timestamp difference between the server and the local.

    Raises
    ------
    AopError
        First calls API '1/system/currentTimeMillis'. So it may fail due to different reasons.

    """
    return get_server_timestamp(appkey, secret, server) - get_local_timestamp()

def get_server_timestamp(appkey, secret, server):
    """
    Returns
    -------
    int
        Milliseconds since midnight, January 1, 1970 UTC. e.g. 1484033752883

    Raises
    ------
    AopError
        Actually calls API '1/system/currentTimeMillis'. So it may fail due to different reasons.

    """
    req = GetServerTimestampRequest(server)
    req.set_appinfo(appkey, secret)
    try:
        return req.get_response()
    except Exception as e:
        raise AopError('Failed to get server timestamp from %s. Reason: %s' % (server, str(e)))

def get_local_timestamp(appkey=None, secret=None, server=None):
     return int(time.time() * 1000)


def get_timestamp_generator():
    return get_local_timestamp

def set_timestamp_generator(timestamp_generator):
    """Set timestamp generator.

    Timestamp is milliseconds since midnight, January 1, 1970 UTC and needed by some APIs
    due to security concerns.

    Timestamp generator is a function taking three arguments: appkey, secret, server domain.

    Generally, there are three policy to generate the timestamp.
    1. Use the local time every time.
        This is the default policy.
        You should first check the time difference between your local machine and the server.
    2. Use the server time every time. NOT RECOMMENDED!
        Just call aop.set_timestamp_generator(aop.get_server_timestamp)
        But remember that there is a call limit for the the API per 10-minutes.
    3. Get the timestamp by the formula: local_timestamp + timestamp_diff.
        "timestamp_diff" is the time difference between the server and the local that saved
        somewhere and periodically synchronized by calling aop.get_timestamp_diff().
        e.g.
            1> periodically synchronize timestamp_diff:
                timestamp_diff = aop.get_timestamp_diff(appkey, secret, server)
            2> aop.set_timestamp_generator(lambda appkey, secret, server: timestamp_diff + aop.get_local_timestamp())

    Parameters
    ----------
        timestamp_generator : callable taking three arguments: appkey, secret, server domain.

    """
    if timestamp_generator:
        default_timestamp_generator = timestamp_generator
        global get_timestamp_generator
        get_timestamp_generator = lambda : default_timestamp_generator



path: aop/api/common/__init__.py
content: # -*- coding: utf-8 -*-
#!/usr/bin/env python

"""
Created on 2016-12-26

@author: Alibaba Open Platform

"""

# from aop.api.common.AuthGetTokenRequest import AuthGetTokenRequest
# from aop.api.common.AuthPostponeTokenRequest import AuthPostponeTokenRequest
from aop.api.common.GetServerTimestampRequest import GetServerTimestampRequest


path: aop/api/common/GetServerTimestampRequest.py
content: # -*- coding: utf-8 -*-
#!/usr/bin/env python

"""
Created on 2016-12-26

@author: Alibaba Open Platform

"""

from aop.api.base import BaseApi

class GetServerTimestampRequest(BaseApi):
    """
    Returns
    -------
    int
        Milliseconds since midnight, January 1, 1970 UTC. e.g. 1484033752883

    """
    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)

    def get_api_uri(self):
        return '1/system/currentTimeMillis'

    def need_sign(self):
        return False

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def need_https(self):
        return False

    def get_multipart_params(self):
        return []

    def get_required_params(self):
        return []

    def is_inner_api(self):
        return False


path: aop/api/__init__.py
content: # -*- coding: utf-8 -*-
#!/usr/bin/env python

"""
Created on 2016-12-26

@author: Alibaba Open Platform

"""

from aop.api.base import FileItem, BaseApi
from aop.api.common import *
from aop.api.biz import *

path: aop/api/biz/UmengApptrackGetStayTrendDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetStayTrendDataRequest(BaseApi):
    """根据用户输入计划id和单元id获取留存数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getStayTrendData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.planId = None
        self.unitId = None
        self.queryDate = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getStayTrendData'

    def get_required_params(self):
        return ['planId', 'queryDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengApptrackGetPayAnalysisDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetPayAnalysisDataRequest(BaseApi):
    """根据计划id或单元id查询出该计划id或单元id下用户拍下订单数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getPayAnalysisData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.planId = None
        self.unitId = None
        self.queryDate = None
        self.pageNum = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getPayAnalysisData'

    def get_required_params(self):
        return ['planId', 'queryDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetRetentionsRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetRetentionsRequest(BaseApi):
    """获取指定App某个时间范围内的新增用户留存率

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getRetentions&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None
        self.channel = None
        self.version = None
        self.type = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getRetentions'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetEventListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetEventListRequest(BaseApi):
    """获取自定义事件列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getEventList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getEventList'

    def get_required_params(self):
        return ['dataSourceId']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetNewAccountsRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetNewAccountsRequest(BaseApi):
    """获取新增账号（仅游戏类型app）

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getNewAccounts&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None
        self.channel = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getNewAccounts'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetAppListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetAppListRequest(BaseApi):
    """获取用户的小程序列表及数量

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getAppList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.pageIndex = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getAppList'

    def get_required_params(self):
        return []

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetMultiIndiceListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetMultiIndiceListRequest(BaseApi):
    """获取分组指标列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getMultiIndiceList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getMultiIndiceList'

    def get_required_params(self):
        return ['dataSourceId']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetChannelOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetChannelOverviewRequest(BaseApi):
    """获取某推广渠道的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getChannelOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.fromDate = None
        self.toDate = None
        self.channel = None
        self.timeUnit = None
        self.dataSourceId = None
        self.indicators = None
        self.pageIndex = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getChannelOverview'

    def get_required_params(self):
        return ['fromDate', 'toDate', 'channel', 'timeUnit', 'dataSourceId', 'indicators']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetTotalUserRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetTotalUserRequest(BaseApi):
    """获取应用的累计用户数

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getTotalUser&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.fromDate = None
        self.toDate = None
        self.pageIndex = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getTotalUser'

    def get_required_params(self):
        return ['dataSourceId', 'fromDate', 'toDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappEventGetUniqueUsersRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappEventGetUniqueUsersRequest(BaseApi):
    """获取自定义事件的独立用户数统计数据（按设备device统计 "data":[{"data":[123],"dates":["2018-01-01"]}）

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.event.getUniqueUsers&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.eventName = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.event.getUniqueUsers'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate', 'eventName']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetAllPropertyValueCountRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetAllPropertyValueCountRequest(BaseApi):
    """获取某事件属性下全部属性值数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getAllPropertyValueCount&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.timeUnit = None
        self.fromDate = None
        self.toDate = None
        self.propertyName = None
        self.pageIndex = None
        self.pageSize = None
        self.eventName = None
        self.dataSourceId = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getAllPropertyValueCount'

    def get_required_params(self):
        return ['timeUnit', 'fromDate', 'toDate', 'propertyName', 'eventName', 'dataSourceId']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetChannelDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetChannelDataRequest(BaseApi):
    """获取指定App按照分发渠道维度的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getChannelData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.date = None
        self.perPage = None
        self.page = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getChannelData'

    def get_required_params(self):
        return ['appkey', 'date']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetMultiOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetMultiOverviewRequest(BaseApi):
    """获取分组指标数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getMultiOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.isv = None
        self.fromDate = None
        self.toDate = None
        self.timeUnit = None
        self.groupName = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getMultiOverview'

    def get_required_params(self):
        return ['dataSourceId', 'isv', 'fromDate', 'toDate', 'timeUnit', 'groupName']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetNewUsersRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetNewUsersRequest(BaseApi):
    """获取指定App某个时间范围内的新增用户数

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getNewUsers&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getNewUsers'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/__init__.py
content: from aop.api.biz.UmengApptrackBackReportDataRequest import UmengApptrackBackReportDataRequest
from aop.api.biz.UmengApptrackGetActiveDetailDataRequest import UmengApptrackGetActiveDetailDataRequest
from aop.api.biz.UmengApptrackGetPayAnalysisDataRequest import UmengApptrackGetPayAnalysisDataRequest
from aop.api.biz.UmengApptrackGetOrderAnalysisDataRequest import UmengApptrackGetOrderAnalysisDataRequest
from aop.api.biz.UmengApptrackGetRegisterAnalysisDataRequest import UmengApptrackGetRegisterAnalysisDataRequest
from aop.api.biz.UmengApptrackGetMonitoringListRequest import UmengApptrackGetMonitoringListRequest
from aop.api.biz.UmengApptrackGetClickActiveDataRequest import UmengApptrackGetClickActiveDataRequest
from aop.api.biz.UmengApptrackGetStayTrendDataRequest import UmengApptrackGetStayTrendDataRequest
from aop.api.biz.UmengApptrackGetPlanListRequest import UmengApptrackGetPlanListRequest
from aop.api.biz.UmengApptrackGetMyEventDataRequest import UmengApptrackGetMyEventDataRequest
from aop.api.biz.UmengApptrackGetRegisterLoginDataRequest import UmengApptrackGetRegisterLoginDataRequest
from aop.api.biz.UmengUappCreateAppRequest import UmengUappCreateAppRequest
from aop.api.biz.UmengUappGetNewAccountsRequest import UmengUappGetNewAccountsRequest
from aop.api.biz.UmengUappGetActiveAccountsRequest import UmengUappGetActiveAccountsRequest
from aop.api.biz.UmengUappGetLaunchesByChannelOrVersionRequest import UmengUappGetLaunchesByChannelOrVersionRequest
from aop.api.biz.UmengUappEventCreateRequest import UmengUappEventCreateRequest
from aop.api.biz.UmengUappGetActiveUsersByChannelOrVersionRequest import UmengUappGetActiveUsersByChannelOrVersionRequest
from aop.api.biz.UmengUappGetNewUsersByChannelOrVersionRequest import UmengUappGetNewUsersByChannelOrVersionRequest
from aop.api.biz.UmengUappEventParamGetValueDurationListRequest import UmengUappEventParamGetValueDurationListRequest
from aop.api.biz.UmengUappGetTodayYesterdayDataRequest import UmengUappGetTodayYesterdayDataRequest
from aop.api.biz.UmengUappGetYesterdayDataRequest import UmengUappGetYesterdayDataRequest
from aop.api.biz.UmengUappGetTodayDataRequest import UmengUappGetTodayDataRequest
from aop.api.biz.UmengUappEventGetUniqueUsersRequest import UmengUappEventGetUniqueUsersRequest
from aop.api.biz.UmengUappGetAllAppDataRequest import UmengUappGetAllAppDataRequest
from aop.api.biz.UmengUappGetAppCountRequest import UmengUappGetAppCountRequest
from aop.api.biz.UmengUappGetChannelDataRequest import UmengUappGetChannelDataRequest
from aop.api.biz.UmengUappGetVersionDataRequest import UmengUappGetVersionDataRequest
from aop.api.biz.UmengUappEventParamGetDataRequest import UmengUappEventParamGetDataRequest
from aop.api.biz.UmengUappEventParamGetValueListRequest import UmengUappEventParamGetValueListRequest
from aop.api.biz.UmengUappEventGetDataRequest import UmengUappEventGetDataRequest
from aop.api.biz.UmengUappEventParamListRequest import UmengUappEventParamListRequest
from aop.api.biz.UmengUappEventListRequest import UmengUappEventListRequest
from aop.api.biz.UmengUappGetRetentionsRequest import UmengUappGetRetentionsRequest
from aop.api.biz.UmengUappGetDurationsRequest import UmengUappGetDurationsRequest
from aop.api.biz.UmengUappGetLaunchesRequest import UmengUappGetLaunchesRequest
from aop.api.biz.UmengUappGetActiveUsersRequest import UmengUappGetActiveUsersRequest
from aop.api.biz.UmengUappGetNewUsersRequest import UmengUappGetNewUsersRequest
from aop.api.biz.UmengUappGetDailyDataRequest import UmengUappGetDailyDataRequest
from aop.api.biz.UmengUappGetAppListRequest import UmengUappGetAppListRequest
from aop.api.biz.UmengUminiGetCustomerSourceOverviewRequest import UmengUminiGetCustomerSourceOverviewRequest
from aop.api.biz.UmengUminiGetMultiIndiceListRequest import UmengUminiGetMultiIndiceListRequest
from aop.api.biz.UmengUminiGetMultiOverviewRequest import UmengUminiGetMultiOverviewRequest
from aop.api.biz.UmengUminiInitMultiLevelTreeRequest import UmengUminiInitMultiLevelTreeRequest
from aop.api.biz.UmengUminiGetSceneInfoListRequest import UmengUminiGetSceneInfoListRequest
from aop.api.biz.UmengUminiGetRetentionByDataSourceIdRequest import UmengUminiGetRetentionByDataSourceIdRequest
from aop.api.biz.UmengUminiGetMultiLevelTreeRequest import UmengUminiGetMultiLevelTreeRequest
from aop.api.biz.UmengUminiGetLandingPageListRequest import UmengUminiGetLandingPageListRequest
from aop.api.biz.UmengUminiGetShareUserListRequest import UmengUminiGetShareUserListRequest
from aop.api.biz.UmengUminiGetVisitPageListRequest import UmengUminiGetVisitPageListRequest
from aop.api.biz.UmengUminiEditPathDisplayNameRequest import UmengUminiEditPathDisplayNameRequest
from aop.api.biz.UmengUminiBatchCreateEventRequest import UmengUminiBatchCreateEventRequest
from aop.api.biz.UmengUminiEditMiniAppRequest import UmengUminiEditMiniAppRequest
from aop.api.biz.UmengUminiGetShareOverviewRequest import UmengUminiGetShareOverviewRequest
from aop.api.biz.UmengUminiGetSharePageOverviewRequest import UmengUminiGetSharePageOverviewRequest
from aop.api.biz.UmengUminiGetAllPropertyValueCountRequest import UmengUminiGetAllPropertyValueCountRequest
from aop.api.biz.UmengUminiGetEventOverviewRequest import UmengUminiGetEventOverviewRequest
from aop.api.biz.UmengUminiGetEventProvertyListRequest import UmengUminiGetEventProvertyListRequest
from aop.api.biz.UmengUminiGetEventListRequest import UmengUminiGetEventListRequest
from aop.api.biz.UmengUminiGetChannelOverviewRequest import UmengUminiGetChannelOverviewRequest
from aop.api.biz.UmengUminiGetCampaignOverviewRequest import UmengUminiGetCampaignOverviewRequest
from aop.api.biz.UmengUminiGetSceneOverviewRequest import UmengUminiGetSceneOverviewRequest
from aop.api.biz.UmengUminiGetAppListRequest import UmengUminiGetAppListRequest
from aop.api.biz.UmengUminiCreateMiniAppRequest import UmengUminiCreateMiniAppRequest
from aop.api.biz.UmengUminiGetOverviewRequest import UmengUminiGetOverviewRequest
from aop.api.biz.UmengUminiGetTotalUserRequest import UmengUminiGetTotalUserRequest


path: aop/api/biz/UmengUminiGetSharePageOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetSharePageOverviewRequest(BaseApi):
    """获取页面分享概况数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getSharePageOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.fromDate = None
        self.toDate = None
        self.timeUnit = None
        self.pageIndex = None
        self.pageSize = None
        self.orderBy = None
        self.direction = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getSharePageOverview'

    def get_required_params(self):
        return ['dataSourceId', 'fromDate', 'toDate', 'timeUnit']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetShareOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetShareOverviewRequest(BaseApi):
    """获取小程序某天的分享数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getShareOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.fromDate = None
        self.toDate = None
        self.timeUnit = None
        self.pageIndex = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getShareOverview'

    def get_required_params(self):
        return ['dataSourceId', 'fromDate', 'toDate', 'timeUnit']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetLandingPageListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetLandingPageListRequest(BaseApi):
    """获取页面分析-入口页面列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getLandingPageList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.timeUnit = None
        self.fromDate = None
        self.toDate = None
        self.orderBy = None
        self.direction = None
        self.pageIndex = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getLandingPageList'

    def get_required_params(self):
        return ['dataSourceId', 'timeUnit', 'fromDate', 'toDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetShareUserListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetShareUserListRequest(BaseApi):
    """获取分享用户列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getShareUserList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.timeUnit = None
        self.fromDate = None
        self.toDate = None
        self.orderBy = None
        self.direction = None
        self.pageIndex = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getShareUserList'

    def get_required_params(self):
        return ['dataSourceId', 'timeUnit', 'fromDate', 'toDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetCampaignOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetCampaignOverviewRequest(BaseApi):
    """获取某推广活动的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getCampaignOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.timeUnit = None
        self.fromDate = None
        self.toDate = None
        self.campaign = None
        self.pageSize = None
        self.pageIndex = None
        self.dataSourceId = None
        self.indicators = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getCampaignOverview'

    def get_required_params(self):
        return ['timeUnit', 'fromDate', 'toDate', 'campaign', 'dataSourceId', 'indicators']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengApptrackGetActiveDetailDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetActiveDetailDataRequest(BaseApi):
    """此接口限定pro用户使用，根据用户输入appKey和计划id，queryDate，返回激活设备明细数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getActiveDetailData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appKey = None
        self.planId = None
        self.queryDate = None
        self.pageNum = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getActiveDetailData'

    def get_required_params(self):
        return ['appKey', 'queryDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetEventProvertyListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetEventProvertyListRequest(BaseApi):
    """获取某自定义事件的属性列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getEventProvertyList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.eventName = None
        self.dataSourceId = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getEventProvertyList'

    def get_required_params(self):
        return ['eventName', 'dataSourceId']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetRetentionByDataSourceIdRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetRetentionByDataSourceIdRequest(BaseApi):
    """获取应用的留存数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getRetentionByDataSourceId&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.fromDate = None
        self.toDate = None
        self.timeUnit = None
        self.pageIndex = None
        self.pageSize = None
        self.indicator = None
        self.valueType = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getRetentionByDataSourceId'

    def get_required_params(self):
        return ['dataSourceId', 'fromDate', 'toDate', 'timeUnit', 'valueType']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiCreateMiniAppRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiCreateMiniAppRequest(BaseApi):
    """新建小程序数据源

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.createMiniApp&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.name = None
        self.type = None
        self.platform = None
        self.language = None
        self.firstLevel = None
        self.secondLevel = None
        self.description = None
        self.miniAppId = None
        self.miniAppSecret = None
        self.miniPublicKey = None
        self.miniPrivateKey = None
        self.integrationType = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.createMiniApp'

    def get_required_params(self):
        return ['name', 'type', 'platform', 'language', 'firstLevel', 'secondLevel']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetAllAppDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetAllAppDataRequest(BaseApi):
    """获取当前用户所有App昨日和今日的基础统计数据（活跃用户数，新增用户数，启动次数，总用户数）

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getAllAppData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getAllAppData'

    def get_required_params(self):
        return []

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetNewUsersByChannelOrVersionRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetNewUsersByChannelOrVersionRequest(BaseApi):
    """根据渠道或版本条件，获取指定App某个时间范围内的新增用户数

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getNewUsersByChannelOrVersion&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None
        self.channels = None
        self.versions = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getNewUsersByChannelOrVersion'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate', 'periodType']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetTodayDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetTodayDataRequest(BaseApi):
    """获取指定App今日的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getTodayData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getTodayData'

    def get_required_params(self):
        return ['appkey']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappEventGetDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappEventGetDataRequest(BaseApi):
    """获取自定义事件事件的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.event.getData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.eventName = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.event.getData'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate', 'eventName']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetYesterdayDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetYesterdayDataRequest(BaseApi):
    """获取指定App昨日的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getYesterdayData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getYesterdayData'

    def get_required_params(self):
        return ['appkey']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengApptrackGetClickActiveDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetClickActiveDataRequest(BaseApi):
    """根据计划id或单元id查询出该计划id或单元id下的点击激活数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getClickActiveData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.planId = None
        self.unitId = None
        self.queryDate = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getClickActiveData'

    def get_required_params(self):
        return ['planId', 'queryDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetActiveUsersRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetActiveUsersRequest(BaseApi):
    """获取指定App某个时间范围内的活跃用户数

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getActiveUsers&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getActiveUsers'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiBatchCreateEventRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiBatchCreateEventRequest(BaseApi):
    """批量创建事件

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.batchCreateEvent&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.eventList = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.batchCreateEvent'

    def get_required_params(self):
        return ['dataSourceId', 'eventList']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengApptrackBackReportDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackBackReportDataRequest(BaseApi):
    """为众盟定制开发的投放报表数据回传接口

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.backReportData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.reportList = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.backReportData'

    def get_required_params(self):
        return ['reportList']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappCreateAppRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappCreateAppRequest(BaseApi):
    """U-App新建数据源

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.createApp&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.name = None
        self.type = None
        self.platform = None
        self.language = None
        self.firstLevel = None
        self.secondLevel = None
        self.description = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.createApp'

    def get_required_params(self):
        return ['name', 'type', 'platform', 'language', 'firstLevel', 'secondLevel']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetAppCountRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetAppCountRequest(BaseApi):
    """获取当前用户所有App的数量

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getAppCount&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getAppCount'

    def get_required_params(self):
        return []

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengApptrackGetRegisterLoginDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetRegisterLoginDataRequest(BaseApi):
    """根据计划id或单元id查询出该计划id或单元id下的注册登录等相关数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getRegisterLoginData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.planId = None
        self.unitId = None
        self.queryDate = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getRegisterLoginData'

    def get_required_params(self):
        return ['planId', 'queryDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetLaunchesByChannelOrVersionRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetLaunchesByChannelOrVersionRequest(BaseApi):
    """根据渠道或版本条件，获取指定App某个时间范围内的启动次数

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getLaunchesByChannelOrVersion&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None
        self.channels = None
        self.versions = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getLaunchesByChannelOrVersion'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate', 'periodType']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappEventListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappEventListRequest(BaseApi):
    """获取自定义事件列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.event.list&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.perPage = None
        self.page = None
        self.version = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.event.list'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiEditPathDisplayNameRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiEditPathDisplayNameRequest(BaseApi):
    """编辑页面路径显示名称

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.editPathDisplayName&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.displayName = None
        self.path = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.editPathDisplayName'

    def get_required_params(self):
        return ['dataSourceId', 'displayName', 'path']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetLaunchesRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetLaunchesRequest(BaseApi):
    """获取指定App某个时间范围内的启动次数

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getLaunches&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getLaunches'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengApptrackGetRegisterAnalysisDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetRegisterAnalysisDataRequest(BaseApi):
    """根据计划id或单元id查询出该计划id或单元id下用户注册事件数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getRegisterAnalysisData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.planId = None
        self.unitId = None
        self.queryDate = None
        self.pageNum = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getRegisterAnalysisData'

    def get_required_params(self):
        return ['planId', 'queryDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengApptrackGetMonitoringListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetMonitoringListRequest(BaseApi):
    """根据用户输入的计划id返回该计划id下的监测单元id

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getMonitoringList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.planId = None
        self.pageNum = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getMonitoringList'

    def get_required_params(self):
        return ['planId']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappEventParamListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappEventParamListRequest(BaseApi):
    """获取自定义事件的参数列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.event.param.list&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.startDate = None
        self.endDate = None
        self.eventId = None
        self.appkey = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.event.param.list'

    def get_required_params(self):
        return ['startDate', 'endDate', 'eventId', 'appkey']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetVisitPageListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetVisitPageListRequest(BaseApi):
    """获取页面分析-受访页面列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getVisitPageList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.timeUnit = None
        self.fromDate = None
        self.toDate = None
        self.orderBy = None
        self.direction = None
        self.pageIndex = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getVisitPageList'

    def get_required_params(self):
        return ['dataSourceId', 'timeUnit', 'fromDate', 'toDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetAppListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetAppListRequest(BaseApi):
    """获取当前用户的所有App列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getAppList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.page = None
        self.perPage = None
        self.accessToken = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getAppList'

    def get_required_params(self):
        return []

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengApptrackGetOrderAnalysisDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetOrderAnalysisDataRequest(BaseApi):
    """根据计划id或单元id查询出该计划id或单元id下用户拍下订单数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getOrderAnalysisData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.planId = None
        self.unitId = None
        self.queryDate = None
        self.pageNum = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getOrderAnalysisData'

    def get_required_params(self):
        return ['planId', 'queryDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetActiveAccountsRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetActiveAccountsRequest(BaseApi):
    """获取活跃账号（仅游戏类型app）

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getActiveAccounts&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None
        self.channel = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getActiveAccounts'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetMultiLevelTreeRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetMultiLevelTreeRequest(BaseApi):
    """获取层级分组结构

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getMultiLevelTree&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getMultiLevelTree'

    def get_required_params(self):
        return ['dataSourceId']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiEditMiniAppRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiEditMiniAppRequest(BaseApi):
    """编辑小程序数据源

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.editMiniApp&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.platform = None
        self.name = None
        self.language = None
        self.firstLevel = None
        self.secondLevel = None
        self.description = None
        self.miniAppId = None
        self.miniAppSecret = None
        self.miniPublicKey = None
        self.miniPrivateKey = None
        self.integrationType = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.editMiniApp'

    def get_required_params(self):
        return ['dataSourceId']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetSceneOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetSceneOverviewRequest(BaseApi):
    """获取某场景值的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getSceneOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.timeUnit = None
        self.fromDate = None
        self.toDate = None
        self.scene = None
        self.pageIndex = None
        self.pageSize = None
        self.dataSourceId = None
        self.indicators = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getSceneOverview'

    def get_required_params(self):
        return ['timeUnit', 'fromDate', 'toDate', 'scene', 'dataSourceId', 'indicators']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetEventOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetEventOverviewRequest(BaseApi):
    """获取某自定义事件统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getEventOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.timeUnit = None
        self.fromDate = None
        self.toDate = None
        self.eventName = None
        self.dataSourceId = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getEventOverview'

    def get_required_params(self):
        return ['timeUnit', 'fromDate', 'toDate', 'eventName', 'dataSourceId']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetDailyDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetDailyDataRequest(BaseApi):
    """获取指定App特定日期的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getDailyData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.date = None
        self.version = None
        self.channel = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getDailyData'

    def get_required_params(self):
        return ['appkey', 'date']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappEventParamGetValueDurationListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappEventParamGetValueDurationListRequest(BaseApi):
    """根据自定义事件参数值，获取使用时长

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.event.param.getValueDurationList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.eventName = None
        self.eventParamName = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.event.param.getValueDurationList'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate', 'eventName', 'eventParamName']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetTodayYesterdayDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetTodayYesterdayDataRequest(BaseApi):
    """获取指定App今天与昨天的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getTodayYesterdayData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getTodayYesterdayData'

    def get_required_params(self):
        return ['appkey']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetCustomerSourceOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetCustomerSourceOverviewRequest(BaseApi):
    """获取-获客来源的指标数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getCustomerSourceOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.sourceType = None
        self.fromDate = None
        self.toDate = None
        self.timeUnit = None
        self.orderBy = None
        self.direction = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getCustomerSourceOverview'

    def get_required_params(self):
        return ['dataSourceId', 'sourceType', 'fromDate', 'toDate', 'timeUnit']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetActiveUsersByChannelOrVersionRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetActiveUsersByChannelOrVersionRequest(BaseApi):
    """根据渠道或版本条件，获取指定App某个时间范围内的活跃用户数

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getActiveUsersByChannelOrVersion&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.periodType = None
        self.channels = None
        self.versions = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getActiveUsersByChannelOrVersion'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate', 'periodType']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengApptrackGetPlanListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetPlanListRequest(BaseApi):
    """根据用户id获得用户计划列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getPlanList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appKey = None
        self.pageNum = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getPlanList'

    def get_required_params(self):
        return []

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetDurationsRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetDurationsRequest(BaseApi):
    """获取指定App某个时间范围内的使用时长统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getDurations&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.date = None
        self.statType = None
        self.channel = None
        self.version = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getDurations'

    def get_required_params(self):
        return ['appkey', 'date']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappEventParamGetDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappEventParamGetDataRequest(BaseApi):
    """获取自定义事件某个参数按照值维度的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.event.param.getData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.eventName = None
        self.eventParamName = None
        self.paramValueName = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.event.param.getData'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate', 'eventName', 'eventParamName', 'paramValueName']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappGetVersionDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappGetVersionDataRequest(BaseApi):
    """获取指定App按照版本维度的统计数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.getVersionData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.date = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.getVersionData'

    def get_required_params(self):
        return ['appkey', 'date']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetSceneInfoListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetSceneInfoListRequest(BaseApi):
    """获取渠道或活动信息列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getSceneInfoList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.sourceType = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getSceneInfoList'

    def get_required_params(self):
        return ['dataSourceId', 'sourceType']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappEventParamGetValueListRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappEventParamGetValueListRequest(BaseApi):
    """获取自定义事件某个参数的取值范围列表

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.event.param.getValueList&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.startDate = None
        self.endDate = None
        self.eventName = None
        self.eventParamName = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.event.param.getValueList'

    def get_required_params(self):
        return ['appkey', 'startDate', 'endDate', 'eventName', 'eventParamName']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUappEventCreateRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUappEventCreateRequest(BaseApi):
    """创建自定义事件

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.uapp&n=umeng.uapp.event.create&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.appkey = None
        self.eventName = None
        self.eventDisplayName = None
        self.eventType = None

    def get_api_uri(self):
        return '1/com.umeng.uapp/umeng.uapp.event.create'

    def get_required_params(self):
        return ['appkey', 'eventName', 'eventDisplayName']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiGetOverviewRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiGetOverviewRequest(BaseApi):
    """获取应用概况数据：启动、活跃、新增、访次、次均停留时长、人均停留时长

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.getOverview&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.fromDate = None
        self.toDate = None
        self.timeUnit = None
        self.indicators = None
        self.pageIndex = None
        self.pageSize = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.getOverview'

    def get_required_params(self):
        return ['dataSourceId', 'fromDate', 'toDate', 'timeUnit', 'indicators']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengApptrackGetMyEventDataRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengApptrackGetMyEventDataRequest(BaseApi):
    """根据用户输入的计划id或者监测单元id返回用户自定义事件数据

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.apptrack&n=umeng.apptrack.getMyEventData&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.planId = None
        self.unitId = None
        self.queryDate = None

    def get_api_uri(self):
        return '1/com.umeng.apptrack/umeng.apptrack.getMyEventData'

    def get_required_params(self):
        return ['planId', 'queryDate']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return False

    def is_inner_api(self):
        return False


path: aop/api/biz/UmengUminiInitMultiLevelTreeRequest.py
content: # -*- coding: utf-8 -*-
from aop.api.base import BaseApi

class UmengUminiInitMultiLevelTreeRequest(BaseApi):
    """上传层级分组结构

    References
    ----------
    https://open.1688.com/api/api.htm?ns=com.umeng.umini&n=umeng.umini.initMultiLevelTree&v=1&cat=default

    """

    def __init__(self, domain=None):
        BaseApi.__init__(self, domain)
        self.dataSourceId = None
        self.treeJson = None

    def get_api_uri(self):
        return '1/com.umeng.umini/umeng.umini.initMultiLevelTree'

    def get_required_params(self):
        return ['dataSourceId', 'treeJson']

    def get_multipart_params(self):
        return []

    def need_sign(self):
        return True

    def need_timestamp(self):
        return False

    def need_auth(self):
        return True

    def is_inner_api(self):
        return False


path: aop/api/base.py
content: # -*- coding: utf-8 -*-
#!/usr/bin/env python

"""
Created on 2016-12-26

@author: Alibaba Open Platform

"""

import sys
import hmac
import hashlib
import requests
try:
    import simplejson as json
except (ImportError, SyntaxError):
    import json

import aop

PY3 = sys.version_info >= (3,)

# constants
P_OPENAPI = 'openapi'
P_API = 'api'
P_PARAM2 = 'param2'

# system parameters
P_ACCESS_TOKEN = 'access_token'
P_TIMESTAMP = '_aop_timestamp'
P_SIGN = '_aop_signature'

P_ERROR_CODE = 'error_code'
P_ERROR_MESSAGE = 'error_message'
P_EXCEPTION = 'exception'
P_REQUEST_ID = 'request_id'

P_SYS_PARAMS =[P_TIMESTAMP, P_SIGN, P_ACCESS_TOKEN]

def is_sys_param(param_name):
    return param_name in P_SYS_PARAMS

def mix_str(pstr):
    if isinstance(pstr, str):
        return pstr
    if not PY3 and isinstance(pstr, unicode):
        return pstr.encode('utf-8')
    else:
        return str(pstr)


###############################################################################
class FileItem(object):
    def __init__(self, filename=None, content=None):
        """
        Parameters
        ----------
        content : file-like-object(str/bytes/bytearray or an object that has read attribute)
            e.g. f = open('filepath', 'rb') ... fileitem = aop.api.FileItem('filename', f)
            e.g. fileitem = aop.api.FileItem('filename', 'file_content_str')

        """
        self.filename = filename
        self.content = content

class BaseApi(object):
    """"Base class of APIs.

    """

    def raise_aop_error(self, *args):
        _args = ['API: ' + self.get_api_uri()]
        if args:
            _args.extend(args)
        raise aop.AopError(*_args)

    def __init__(self, domain=None):
        """

        Parameters
        ----------
        domain : str
            Remote server domain. e.g. 'gw.open.1688.com' for 1688.

        """
        self.__domain = domain
        if not self.__domain and aop.get_default_server():
            self.__domain = aop.get_default_server()
        self.__httpmethod = "POST"
        default_appinfo = aop.get_default_appinfo()
        if default_appinfo:
            self.__appkey = default_appinfo.appkey
            self.__secret = default_appinfo.secret
        else:
            self.__appkey = ''
            self.__secret = ''
        self.__need_https = True

    def sign(self, urlPath, params, secret):
        """Method to generate _aop_signature.

        Parameters
        ----------
        urlPath : str
            param2/version/namespace/name/appkey
        params : dict-like
        secret : str

        References
        ----------
        https://open.1688.com/api/sysSignature.htm

        """
        if not urlPath:
            self.raise_aop_error('sign error: urlPath missing')
        if not [REDACTED_SECRET]'sign error: secret missing')
        paramList = []
        if params:
            if not hasattr(params, "items"):
                self.raise_aop_error('sign error: params must be dict-like')
            paramList = [mix_str(k) + mix_str(v) for k, v in params.items()]
            paramList = sorted(paramList)

        msg = bytearray(urlPath.encode('utf-8'))
        for param in paramList:
            msg.extend(bytes(param.encode('utf-8')))

        sha = hmac.new(bytes(secret.encode('utf-8')), None, hashlib.sha1)
        sha.update(msg)
        return sha.hexdigest().upper()

    def set_timestamp(self, timestamp):
        self._aop_timestamp = timestamp

    def set_need_https(self, need_https):
        self.__need_https = need_https

    def set_accesstoken(self, access_token):
        self.access_token = access_token

    def set_appinfo(self, appkey, secret):
        if appkey and [REDACTED_SECRET] = appkey
            self.__secret = secret

#################### Methods to implement by subclasses, begin
    def get_api_uri(self):
        """
        Returns
        -------
        str
            version/namespace/name
        """
        return ''

    def need_sign(self):
        """True if _aop_signature is needed"""
        return False

    def need_timestamp(self):
        """True if _aop_timestamp is needed"""
        return False

    def need_auth(self):
        """True if access_token is needed"""
        return False

    def need_https(self):
        """True if to send a https request"""
        return self.__need_https

    def is_inner_api(self):
        """True if not an open api. Usually false."""
        return False

    def get_multipart_params(self):
        """
        Returns
        -------
        list
            API parameters with type of byte[].
            A multipart request will be sent if not empty.
            e.g. returns ['image'] if the 'image' parameter's type is byte[].
                Then assign it as req.image = aop.api.FileItem('imagename.png', imagecontent)

        """
        return []

    def get_required_params(self):
        """
        Names of required API parameters.
        System parameters(access_token/_aop_timestamp/_aop_signature) excluded.

        An AopError with message 'Required params missing: {"missing_param1_name", ...}'
        will be thrown out if some of the required API parameters are missing before a
        request sent to the remote server.

        """
        return []
#################### Methods to implement by subclass, end

    def __get_url_protocol(self):
        return 'https' if self.need_https() else 'http'

    def _build_sign_url_path(self):
        return '%s/%s/%s' % (P_PARAM2, self.get_api_uri(), self.__appkey)

    def _build_url(self, sign_url_path):
        return '%s://%s/%s/%s' % (self.__get_url_protocol(), self.__domain,
                                  P_API if self.is_inner_api() else P_OPENAPI, sign_url_path)

    def _check_sign(self):
        if self.need_sign():
            if not self.__appkey:
                self.raise_aop_error('AppKey missing')
            if not self.__secret:
                self.raise_aop_error('App secret missing')

    def _check_auth(self, **kwargs):
        if self.need_auth():
            if not kwargs.get(P_ACCESS_TOKEN):
                self.raise_aop_error('access_token missing')

    def _check_required_params(self, **kwargs):
        missing_params = set(self.get_required_params()) - set(kwargs.keys())
        if missing_params:
            self.raise_aop_error('Required params missing: %s' % (str(missing_params)))

    def _gen_timestamp(self, server):
        timestamp_generator = aop.get_timestamp_generator()
        if not timestamp_generator:
            timestamp_generator = aop.get_local_timestamp
        try:
            return timestamp_generator(self.__appkey, self.__secret, server)
        except Exception as e:
            self.raise_aop_error('Failed to generate timestamp. Error: ' + str(e))

    def _check_server(self):
        if not self.__domain:
            if aop.get_default_server():
                self.__domain = aop.get_default_server()
            else:
                self.raise_aop_error('Remote server domain not set')

    def get_response(self, timeout=None, **kwargs):
        self._check_server()

        params = self._get_nonnull_biz_params()
        if kwargs:
            params.update(kwargs)

        if self.need_sign():
            self._check_sign()
        # if self.need_auth():
        #     self._check_auth(**params)
        if self.get_required_params():
            self._check_required_params(**params)
        if self.need_timestamp() and (not params.get(P_TIMESTAMP)):
                params[P_TIMESTAMP] = self._gen_timestamp(self.__domain)

        for multipart_param in self.get_multipart_params():
            params.pop(multipart_param)

        sign_url_path = self._build_sign_url_path()
        if self.need_sign() and (not params.get(P_SIGN)):
            params[P_SIGN] = self.sign(sign_url_path, params, self.__secret)

        url = self._build_url(sign_url_path)
        headers = self._get_request_header();

        files = {}
        if self.get_multipart_params():
            for key in self.get_multipart_params():
                fileitem = getattr(self, key)
                if(fileitem and isinstance(fileitem, FileItem)):
                    files[key] = (fileitem.filename, fileitem.content)
                else:
                    self.raise_aop_error(key + ' not a FileItem')

        resp = self._do_request(url, params, files, headers=headers, timeout=timeout);

        failed = not (resp.status_code >= 200 and resp.status_code < 400)
        ret = resp.text

        try:
            ret = json.loads(ret)
        except Exception as e:
                if failed:
                    self.raise_aop_error('API call error. status_code:%s response:%s' % (str(resp.status_code), str(ret)))
                else:
                    self.raise_aop_error('API call seemed to go ok. But we failed to read the json data. status_code:%s response:%s' % (str(resp.status_code), str(ret)))

        if failed:
            error = aop.ApiError()
            error.api = self.get_api_uri()
            if hasattr(ret, 'get'):
                error.error_code = ret.get(P_ERROR_CODE)
                error.error_message = ret.get(P_ERROR_MESSAGE)
                error.exception = ret.get(P_EXCEPTION)
                error.request_id = ret.get(P_REQUEST_ID)
            raise error

        return ret

    def _do_request(self, url, data=None, files=None, **kwargs):
        try:
            if files:
                return requests.post(url, data=data, files=files, **kwargs)
            else:
                return requests.post(url, data=data, **kwargs)
        except requests.RequestException as e:
                self.raise_aop_error(str(e))

    def _get_request_header(self):
        return {
                 'Cache-Control': 'no-cache',
                 'Connection': 'Keep-Alive',
                 'User-Agent':'Ocean-SDK-Client'
        }

    def _is_nonnull_biz_param(self, param_name, param_value):
        if is_sys_param(param_name):
            return True
        return (not param_name.startswith("__")) \
            and (not param_name.startswith("_BaseApi__")) \
            and param_value

    def _get_nonnull_biz_params(self):
        biz_params = {}
        for key, value in self.__dict__.items():
            if self._is_nonnull_biz_param(key, value):
                biz_params[key] = value
        return biz_params



path: umeng_config.py
content: #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
友盟配置管理模块
支持从 umeng-config.json 配置文件或环境变量读取认证信息
"""

import os
import json
from pathlib import Path


def find_config_file():
    """
    查找 umeng-config.json 配置文件
    
    搜索顺序：
    1. 当前工作目录
    2. 用户主目录
    3. 技能目录
    
    Returns:
        str: 配置文件路径，如果不存在则返回 None
    """
    # 可能的配置文件路径
    config_paths = [
        Path.cwd() / 'umeng-config.json',
        Path.home() / 'umeng-config.json',
        Path(__file__).parent.parent / 'umeng-config.json',
    ]
    
    for config_path in config_paths:
        if config_path.exists():
            return str(config_path)
    
    return None


def load_config(config_path=None):
    """
    加载友盟配置文件
    
    Args:
        config_path (str, optional): 配置文件路径，如果为 None 则自动查找
        
    Returns:
        dict: 配置信息，包含 apiKey 和 apiSecurity
        None: 如果配置文件不存在
        
    Raises:
        json.JSONDecodeError: JSON 格式错误
        PermissionError: 文件无权限读取
    """
    if config_path is None:
        config_path = find_config_file()
    
    if config_path is None:
        return None
    
    try:
        with open(config_path, 'r', encoding='utf-8') as f:
            config = json.load(f)
        
        # 支持多种字段名
        [REDACTED_SECRET]'apiKey') or config.get('api_key') or config.get('UMENG_API_KEY')
        api_security = config.get('apiSecurity') or config.get('api_security') or config.get('UMENG_API_SECURITY')
        
        return {
            'apiKey': api_key,
            'apiSecurity': api_security,
            'configPath': config_path
        }
    except json.JSONDecodeError as e:
        raise json.JSONDecodeError(f"Invalid JSON in config file {config_path}: {e.msg}", e.doc, e.pos)
    except Exception as e:
        raise Exception(f"Failed to load config from {config_path}: {str(e)}")


def get_umeng_credentials(api_key=None, api_security=None):
    """
    获取友盟认证信息
    
    优先级顺序：
    1. 直接传入的参数（最高优先级）
    2. umeng-config.json 配置文件
    3. 环境变量（UMENG_API_KEY, UMENG_API_SECURITY）
    
    Args:
        api_key (str, optional): 直接传入的 API Key
        api_security (str, optional): 直接传入的 API Security
        
    Returns:
        dict: 包含 apiKey 和 apiSecurity 的字典
        
    Raises:
        ValueError: 如果所有来源都未找到认证信息
    """
    # 1. 优先使用直接传入的参数
    if api_key and api_security:
        return {
            'apiKey': api_key,
            'apiSecurity': api_security,
            'source': 'parameters'
        }
    
    # 2. 尝试从配置文件读取
    try:
        config = load_config()
        if config and config.get('apiKey') and config.get('apiSecurity'):
            return {
                'apiKey': config['apiKey'],
                'apiSecurity': config['apiSecurity'],
                'source': 'config',
                'configPath': config.get('configPath')
            }
    except Exception:
        # 配置文件读取失败，继续尝试环境变量
        pass
    
    # 3. 尝试从环境变量读取
    env_api_key = os.getenv("UMENG_API_KEY")
    env_api_security = os.getenv("UMENG_API_SECURITY")
    
    if env_api_key and env_api_security:
        return {
            'apiKey': env_api_key,
            'apiSecurity': env_api_security,
            'source': 'environment'
        }
    
    # 所有来源都未找到
    raise ValueError(
        "友盟认证信息未找到。请通过以下方式之一配置：\n"
        "1. 创建 umeng-config.json 文件，包含 apiKey 和 apiSecurity 字段\n"
        "2. 设置环境变量 UMENG_API_KEY 和 UMENG_API_SECURITY\n"
        "3. 在调用时直接传入 apiKey 和 apiSecurity 参数"
    )


def save_config(api_key, api_security, config_path=None):
    """
    保存友盟配置到文件
    
    Args:
        api_key (str): API Key
        api_security (str): API Security
        config_path (str, optional): 配置文件路径，默认为用户主目录
        
    Returns:
        str: 保存的配置文件路径
    """
    if config_path is None:
        config_path = Path.home() / 'umeng-config.json'
    else:
        config_path = Path(config_path)
    
    config = {
        'apiKey': api_key,
        'apiSecurity': api_security,
        'note': '友盟 API 配置文件 - 请妥善保管，不要提交到版本控制系统'
    }
    
    # 确保目录存在
    config_path.parent.mkdir(parents=True, exist_ok=True)
    
    with open(config_path, 'w', encoding='utf-8') as f:
        json.dump(config, f, indent=2, ensure_ascii=False)
    
    # 设置文件权限（仅所有者可读写）
    try:
        os.chmod(config_path, 0o600)
    except Exception:
        pass  # 在某些系统上可能不支持 chmod
    
    return str(config_path)


# 使用示例
if __name__ == "__main__":
    # 示例：获取认证信息
    try:
        creds = get_umeng_credentials()
        print(f"认证信息来源：{creds['source']}")
        print(f"API Key: {creds['apiKey'][:10]}...")
        print(f"API Security: {creds['apiSecurity'][:10]}...")
    except ValueError as e:
        print(f"Error: {e}")
    
    # 示例：保存配置
    # config_path = save_config("your_api_key", "your_api_security")
    # print(f"配置已保存到：{config_path}")


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)