Class: WhopSDK::Resources::AdReports

Inherits:
Object
  • Object
show all
Defined in:
lib/whop_sdk/resources/ad_reports.rb,
sig/whop_sdk/resources/ad_reports.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ AdReports

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of AdReports.

Parameters:



59
60
61
# File 'lib/whop_sdk/resources/ad_reports.rb', line 59

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(from:, to:, ad_campaign_ids: nil, ad_group_ids: nil, ad_ids: nil, breakdown: nil, company_id: nil, currency: nil, granularity: nil, request_options: {}) ⇒ WhopSDK::Models::AdReportRetrieveResponse

Some parameter documentations has been truncated, see Models::AdReportRetrieveParams for more details.

Performance report for a company, ad campaigns, ad groups, or ads. Always returns aggregate summary totals summed across the scope. Set granularity to additionally get a time series, or set breakdown (campaign/ad_group/ad) to additionally get per-entity rows inside the requested scope. Exactly one of companyId, adCampaignIds, adGroupIds, or adIds must be provided.

Required permissions:

  • ad_campaign:stats:read

Parameters:

  • from (Time)

    Inclusive start of the reporting window.

  • to (Time)

    Inclusive end of the reporting window.

  • ad_campaign_ids (Array<String>, nil)

    Scope the report to these ad campaigns (max 100); stats are summed across them.

  • ad_group_ids (Array<String>, nil)

    Scope the report to these ad groups (max 100); stats are summed across them. Mut

  • ad_ids (Array<String>, nil)

    Scope the report to these ads (max 100); stats are summed across them. Mutually

  • breakdown (Symbol, WhopSDK::Models::AdReportRetrieveParams::Breakdown, nil)

    Entity level to group an ad report by.

  • company_id (String, nil)

    The unique identifier of a company. Mutually exclusive with adCampaignIds, `ad

  • currency (String, nil)

    ISO 4217 currency code to report spend in. Defaults to the company's ads repor

  • granularity (Symbol, WhopSDK::Models::Granularities, nil)

    Bucket size for external ad stat rows.

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/whop_sdk/resources/ad_reports.rb', line 44

def retrieve(params)
  parsed, options = WhopSDK::AdReportRetrieveParams.dump_request(params)
  query = WhopSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "ad_reports",
    query: query,
    model: WhopSDK::Models::AdReportRetrieveResponse,
    options: options
  )
end