Skip to content

Wave 2 (#402): expose strategies get nested *FieldNames as CLI options #414

Description

@axisrow

Context

Sub-task of #402 (Wave 2: expose remaining nested *FieldNames request parameters as CLI options).

The strategies.get request type declares 16 nested *FieldNames parameters that have no dedicated kebab-case CLI option. They are currently registered in NESTED_FIELDNAMES_EXCLUSIONS (tests/test_api_coverage.py) with the #402 marker so test_every_nested_fieldnames_param_has_cli_option passes.

This is one of the two largest groups in Wave 2 (along with ads get) — splitting into smaller PRs (e.g. by Cpa / Cpc / PayForConversion families) is acceptable as long as each PR removes the corresponding NESTED_FIELDNAMES_EXCLUSIONS rows.

Scope — WSDL parameters to expose

WSDL parameter Proposed CLI option
StrategyAverageCpaFieldNames --strategy-average-cpa-field-names
StrategyAverageCpaMultipleGoalsFieldNames --strategy-average-cpa-multiple-goals-field-names
StrategyAverageCpaPerCampaignFieldNames --strategy-average-cpa-per-campaign-field-names
StrategyAverageCpaPerFilterFieldNames --strategy-average-cpa-per-filter-field-names
StrategyAverageCpcFieldNames --strategy-average-cpc-field-names
StrategyAverageCpcPerCampaignFieldNames --strategy-average-cpc-per-campaign-field-names
StrategyAverageCpcPerFilterFieldNames --strategy-average-cpc-per-filter-field-names
StrategyAverageCrrFieldNames --strategy-average-crr-field-names
StrategyMaxProfitFieldNames --strategy-max-profit-field-names
StrategyMaximumClicksFieldNames --strategy-maximum-clicks-field-names
StrategyMaximumConversionRateFieldNames --strategy-maximum-conversion-rate-field-names
StrategyPayForConversionCrrFieldNames --strategy-pay-for-conversion-crr-field-names
StrategyPayForConversionFieldNames --strategy-pay-for-conversion-field-names
StrategyPayForConversionMultipleGoalsFieldNames --strategy-pay-for-conversion-multiple-goals-field-names
StrategyPayForConversionPerCampaignFieldNames --strategy-pay-for-conversion-per-campaign-field-names
StrategyPayForConversionPerFilterFieldNames --strategy-pay-for-conversion-per-filter-field-names

Reference implementation

  • direct_cli/commands/adextensions.py — original --callout-field-names pattern (PR [codex] Add adextensions CalloutFieldNames flag #359).
  • direct_cli/commands/sitelinks.py:114 and direct_cli/commands/keywordbids.py — Wave 1 examples (PR feat(api): expose separate *FieldNames params for sitelinks and keywordbids #403): each option parses CSV via parse_csv_strings, rejects empty input with click.UsageError, sets the WSDL key only when non-empty, and (for multi-FieldNames resources) falls back to the matching COMMON_FIELDS[<service>]["<XxxFieldNames>"] default.
  • direct_cli/utils.pyCOMMON_FIELDS dict: extend with a dict[str, list[str]] entry keyed by the WSDL request param.

Acceptance

  • Each WSDL parameter above has a kebab-case --<name>-field-names flag on direct strategies get.
  • Empty CSV (--<name>-field-names "") raises click.UsageError.
  • Corresponding rows in NESTED_FIELDNAMES_EXCLUSIONS removed.
  • New dry-run tests in tests/test_dry_run.py mirroring the sitelinks_get / keywordbids_get shape.
  • pytest tests/test_api_coverage.py::test_every_nested_fieldnames_param_has_cli_option passes without those exclusions.
  • CHANGELOG.md entry under Unreleased.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions