12个稳定版本

3.1.0+20220307 2022年4月26日
3.0.0+20220307 2022年3月8日
2.0.4+20210331 2021年4月14日
1.0.14+20200709 2020年7月10日
1.0.7+20171208 2018年2月1日

#57#json-input

Download history 79/week @ 2024-03-30 14/week @ 2024-04-06

每月75次 下载

MIT 许可证

1.5MB
22K SLoC

adexchangebuyer2-v2-beta1 命令行界面(CLI)允许您从终端方便地使用Google AdExchangeBuyerII服务的几乎所有功能。

默认情况下,所有输出都打印到标准输出,但可以设置标志将其直接重定向到文件,而不考虑您的shell功能。错误将打印到标准错误,并导致程序的退出码不为零。

如果请求数据结构,这些将作为格式化良好的JSON返回,以便作为其他工具的输入使用。

有关AdExchangeBuyerII API的所有其他信息,请参阅官方文档网站

安装和源代码

使用cargo安装命令行界面:

cargo install google-adexchangebuyer2_v2_beta1-cli

GitHub上找到源代码

用法

本文档是根据修订版20220307的AdExchangeBuyerII API生成的。CLI版本为3.1.0

adexchangebuyer2-v2-beta1 [options]
        accounts
                clients-create <account-id> (-r <kv>)... [-p <v>]... [-o <out>]
                clients-get <account-id> <client-account-id> [-p <v>]... [-o <out>]
                clients-invitations-create <account-id> <client-account-id> (-r <kv>)... [-p <v>]... [-o <out>]
                clients-invitations-get <account-id> <client-account-id> <invitation-id> [-p <v>]... [-o <out>]
                clients-invitations-list <account-id> <client-account-id> [-p <v>]... [-o <out>]
                clients-list <account-id> [-p <v>]... [-o <out>]
                clients-update <account-id> <client-account-id> (-r <kv>)... [-p <v>]... [-o <out>]
                clients-users-get <account-id> <client-account-id> <user-id> [-p <v>]... [-o <out>]
                clients-users-list <account-id> <client-account-id> [-p <v>]... [-o <out>]
                clients-users-update <account-id> <client-account-id> <user-id> (-r <kv>)... [-p <v>]... [-o <out>]
                creatives-create <account-id> (-r <kv>)... [-p <v>]... [-o <out>]
                creatives-deal-associations-add <account-id> <creative-id> (-r <kv>)... [-p <v>]... [-o <out>]
                creatives-deal-associations-list <account-id> <creative-id> [-p <v>]... [-o <out>]
                creatives-deal-associations-remove <account-id> <creative-id> (-r <kv>)... [-p <v>]... [-o <out>]
                creatives-get <account-id> <creative-id> [-p <v>]... [-o <out>]
                creatives-list <account-id> [-p <v>]... [-o <out>]
                creatives-stop-watching <account-id> <creative-id> (-r <kv>)... [-p <v>]... [-o <out>]
                creatives-update <account-id> <creative-id> (-r <kv>)... [-p <v>]... [-o <out>]
                creatives-watch <account-id> <creative-id> (-r <kv>)... [-p <v>]... [-o <out>]
                finalized-proposals-list <account-id> [-p <v>]... [-o <out>]
                finalized-proposals-pause <account-id> <proposal-id> (-r <kv>)... [-p <v>]... [-o <out>]
                finalized-proposals-resume <account-id> <proposal-id> (-r <kv>)... [-p <v>]... [-o <out>]
                products-get <account-id> <product-id> [-p <v>]... [-o <out>]
                products-list <account-id> [-p <v>]... [-o <out>]
                proposals-accept <account-id> <proposal-id> (-r <kv>)... [-p <v>]... [-o <out>]
                proposals-add-note <account-id> <proposal-id> (-r <kv>)... [-p <v>]... [-o <out>]
                proposals-cancel-negotiation <account-id> <proposal-id> (-r <kv>)... [-p <v>]... [-o <out>]
                proposals-complete-setup <account-id> <proposal-id> (-r <kv>)... [-p <v>]... [-o <out>]
                proposals-create <account-id> (-r <kv>)... [-p <v>]... [-o <out>]
                proposals-get <account-id> <proposal-id> [-p <v>]... [-o <out>]
                proposals-list <account-id> [-p <v>]... [-o <out>]
                proposals-pause <account-id> <proposal-id> (-r <kv>)... [-p <v>]... [-o <out>]
                proposals-resume <account-id> <proposal-id> (-r <kv>)... [-p <v>]... [-o <out>]
                proposals-update <account-id> <proposal-id> (-r <kv>)... [-p <v>]... [-o <out>]
                publisher-profiles-get <account-id> <publisher-profile-id> [-p <v>]... [-o <out>]
                publisher-profiles-list <account-id> [-p <v>]... [-o <out>]
        bidders
                accounts-filter-sets-bid-metrics-list <filter-set-name> [-p <v>]... [-o <out>]
                accounts-filter-sets-bid-response-errors-list <filter-set-name> [-p <v>]... [-o <out>]
                accounts-filter-sets-bid-responses-without-bids-list <filter-set-name> [-p <v>]... [-o <out>]
                accounts-filter-sets-create <owner-name> (-r <kv>)... [-p <v>]... [-o <out>]
                accounts-filter-sets-delete <name> [-p <v>]... [-o <out>]
                accounts-filter-sets-filtered-bid-requests-list <filter-set-name> [-p <v>]... [-o <out>]
                accounts-filter-sets-filtered-bids-creatives-list <filter-set-name> <creative-status-id> [-p <v>]... [-o <out>]
                accounts-filter-sets-filtered-bids-details-list <filter-set-name> <creative-status-id> [-p <v>]... [-o <out>]
                accounts-filter-sets-filtered-bids-list <filter-set-name> [-p <v>]... [-o <out>]
                accounts-filter-sets-get <name> [-p <v>]... [-o <out>]
                accounts-filter-sets-impression-metrics-list <filter-set-name> [-p <v>]... [-o <out>]
                accounts-filter-sets-list <owner-name> [-p <v>]... [-o <out>]
                accounts-filter-sets-losing-bids-list <filter-set-name> [-p <v>]... [-o <out>]
                accounts-filter-sets-non-billable-winning-bids-list <filter-set-name> [-p <v>]... [-o <out>]
                filter-sets-bid-metrics-list <filter-set-name> [-p <v>]... [-o <out>]
                filter-sets-bid-response-errors-list <filter-set-name> [-p <v>]... [-o <out>]
                filter-sets-bid-responses-without-bids-list <filter-set-name> [-p <v>]... [-o <out>]
                filter-sets-create <owner-name> (-r <kv>)... [-p <v>]... [-o <out>]
                filter-sets-delete <name> [-p <v>]... [-o <out>]
                filter-sets-filtered-bid-requests-list <filter-set-name> [-p <v>]... [-o <out>]
                filter-sets-filtered-bids-creatives-list <filter-set-name> <creative-status-id> [-p <v>]... [-o <out>]
                filter-sets-filtered-bids-details-list <filter-set-name> <creative-status-id> [-p <v>]... [-o <out>]
                filter-sets-filtered-bids-list <filter-set-name> [-p <v>]... [-o <out>]
                filter-sets-get <name> [-p <v>]... [-o <out>]
                filter-sets-impression-metrics-list <filter-set-name> [-p <v>]... [-o <out>]
                filter-sets-list <owner-name> [-p <v>]... [-o <out>]
                filter-sets-losing-bids-list <filter-set-name> [-p <v>]... [-o <out>]
                filter-sets-non-billable-winning-bids-list <filter-set-name> [-p <v>]... [-o <out>]
  adexchangebuyer2-v2-beta1 --help

Configuration:
  [--scope <url>]...
            Specify the authentication a method should be executed in. Each scope
            requires the user to grant this application permission to use it.
            If unset, it defaults to the shortest scope url for a particular method.
  --config-dir <folder>
            A directory into which we will store our persistent data. Defaults to
            a user-writable directory that we will create during the first invocation.
            [default: ~/.google-service-cli]

配置

程序将所有持久数据存储在~/.google-service-cli目录下的JSON文件中,以adexchangebuyer2-v2-beta1-为前缀。您可以使用--config-dir标志在每次调用中更改用于存储配置的目录。

以下段落中提供了有关各种类型持久数据的更多信息。

身份验证

大多数API要求用户对任何请求进行身份验证。如果是这样,则作用域确定授予的权限集。这些的粒度通常不超过只读完全访问

如果未设置,系统将自动选择最小的可行范围,例如在调用只读方法时,它将只请求只读范围。您可以使用 --scope 标志直接指定范围。所有适用的范围均在各自方法的CLI文档中进行了说明。

首次使用范围时,用户会被要求授权。根据CLI的指示授权或拒绝。

如果用户认证了某个范围,相关的信息将以 JSON 格式存储在配置目录中,例如 ~/.google-service-cli/adexchangebuyer2-v2-beta1-token-<scope-hash>.json。无需手动管理这些令牌。

要撤销授权的认证,请参阅官方文档

应用程序密钥

为了允许任何应用程序使用Google服务,它需要使用Google开发者控制台进行注册。然后逐个为应用程序启用可能使用的API。大多数API可以免费使用,并且有每日配额。

为了在不强迫用户注册自己的应用程序的情况下更方便地使用CLI,CLI附带了一个默认的应用程序密钥,相应地进行了配置。这也意味着全球范围内的重用可能会耗尽每日配额。

您可以通过将您自己的密钥文件放在此位置来解决这个问题: ~/.google-service-cli/adexchangebuyer2-v2-beta1-secret.json,假设已为它启用了所需的 adexchangebuyer2 API。这样的密钥文件可以从 Google开发者控制台APIs & auth -> Credentials -> Download JSON 下载并直接使用。

有关如何设置Google项目和启用API的更多信息,请参阅官方文档

调试

尽管CLI尽力提供可用的错误消息,但有时了解导致特定问题的确切原因可能是有益的。这是通过允许所有客户端服务器通信以 原样 输出到标准错误来完成的。

使用 --debug 标志将使用 Debug 表示法将错误打印到标准错误。

您可以考虑将标准错误重定向到文件以提高易用性,例如 adexchangebuyer2-v2-beta1 --debug <resource> <method> [options] 2>debug.txt

依赖关系

~18–31MB
~575K SLoC