59 lines
1.9 KiB
C#
59 lines
1.9 KiB
C#
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;
|
|
}
|