Initial import into Gitea
This commit is contained in:
58
GoogleApi/Models/AudienceModels.cs
Normal file
58
GoogleApi/Models/AudienceModels.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
namespace GoogleApi.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an audience segment from Google Ads (affinity, in-market, life events, etc.)
|
||||
/// </summary>
|
||||
public class AudienceSegment
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Type { get; set; } = string.Empty; // AFFINITY, IN_MARKET, LIFE_EVENT, DETAILED_DEMOGRAPHIC
|
||||
public string? ParentName { get; set; }
|
||||
public int? ParentId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Response containing all available audience segments
|
||||
/// </summary>
|
||||
public class AudienceSegmentsResponse
|
||||
{
|
||||
public List<AudienceSegment> Affinity { get; set; } = new();
|
||||
public List<AudienceSegment> InMarket { get; set; } = new();
|
||||
public List<AudienceSegment> LifeEvents { get; set; } = new();
|
||||
public List<AudienceSegment> DetailedDemographics { get; set; } = new();
|
||||
public int TotalCount => Affinity.Count + InMarket.Count + LifeEvents.Count + DetailedDemographics.Count;
|
||||
public DateTimeOffset RetrievedAt { get; set; } = DateTimeOffset.UtcNow;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Geo target constant for location targeting
|
||||
/// </summary>
|
||||
public class GeoTarget
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string CanonicalName { get; set; } = string.Empty;
|
||||
public string TargetType { get; set; } = string.Empty; // City, State, Country, etc.
|
||||
public string? CountryCode { get; set; }
|
||||
public string? ParentGeoTarget { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Response for geo target search
|
||||
/// </summary>
|
||||
public class GeoTargetSearchResponse
|
||||
{
|
||||
public List<GeoTarget> Results { get; set; } = new();
|
||||
public string Query { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Payload for searching geo targets
|
||||
/// </summary>
|
||||
public class GeoTargetSearchPayload
|
||||
{
|
||||
public string Query { get; set; } = string.Empty;
|
||||
public string? CountryCode { get; set; }
|
||||
public int MaxResults { get; set; } = 20;
|
||||
}
|
||||
59
GoogleApi/Models/ForecastModels.cs
Normal file
59
GoogleApi/Models/ForecastModels.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
namespace GoogleApi.Models;
|
||||
|
||||
#region Forecast Payloads
|
||||
|
||||
/// <summary>
|
||||
/// Payload for KeywordForecast operation.
|
||||
/// Gateway sends targeting + budget; we translate to GenerateKeywordForecastMetrics.
|
||||
/// </summary>
|
||||
public sealed class KeywordForecastPayload
|
||||
{
|
||||
/// <summary>Keywords to forecast (from wizard Step 1 URL analysis)</summary>
|
||||
public List<string> Keywords { get; set; } = new();
|
||||
|
||||
/// <summary>Geo target IDs (Google Ads geo constants)</summary>
|
||||
public List<long> GeoTargetIds { get; set; } = new();
|
||||
|
||||
/// <summary>Monthly budget in whole currency units allocated to this channel</summary>
|
||||
public decimal MonthlyBudget { get; set; }
|
||||
|
||||
/// <summary>Currency code</summary>
|
||||
public string CurrencyCode { get; set; } = "USD";
|
||||
|
||||
/// <summary>Forecast period in days (default 30)</summary>
|
||||
public int ForecastDays { get; set; } = 30;
|
||||
|
||||
/// <summary>Campaign type for bid simulation</summary>
|
||||
public CampaignType CampaignType { get; set; } = CampaignType.Search;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Response from keyword forecast — monthly estimated metrics.
|
||||
/// </summary>
|
||||
public sealed class KeywordForecastResponse
|
||||
{
|
||||
public string Provider { get; set; } = "google";
|
||||
public ForecastEstimates Monthly { get; set; } = new();
|
||||
public ForecastMetrics Metrics { get; set; } = new();
|
||||
public string Confidence { get; set; } = "none";
|
||||
public string DataSource { get; set; } = "emulated";
|
||||
}
|
||||
|
||||
public sealed class ForecastEstimates
|
||||
{
|
||||
public double Impressions { get; set; }
|
||||
public double Clicks { get; set; }
|
||||
public decimal Cost { get; set; }
|
||||
public double Conversions { get; set; }
|
||||
public double? Reach { get; set; }
|
||||
}
|
||||
|
||||
public sealed class ForecastMetrics
|
||||
{
|
||||
public decimal AvgCpc { get; set; }
|
||||
public decimal AvgCpm { get; set; }
|
||||
public double Ctr { get; set; }
|
||||
public decimal? EstimatedCpa { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -36,6 +36,25 @@ public sealed class ListCampaignsPayload
|
||||
|
||||
#endregion
|
||||
|
||||
#region Account Payloads
|
||||
|
||||
public sealed class CreateCustomerClientPayload
|
||||
{
|
||||
/// <summary>Display name for the new sub-account (used for billing reconciliation)</summary>
|
||||
public string AccountName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>Currency code (e.g. "USD")</summary>
|
||||
public string CurrencyCode { get; set; } = "USD";
|
||||
|
||||
/// <summary>Time zone (e.g. "America/Los_Angeles")</summary>
|
||||
public string TimeZone { get; set; } = "America/Los_Angeles";
|
||||
|
||||
/// <summary>Optional descriptive name visible in MCC (defaults to AccountName)</summary>
|
||||
public string? DescriptiveName { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Reporting Payloads
|
||||
|
||||
public sealed class CampaignStatsPayload
|
||||
|
||||
Reference in New Issue
Block a user