Skip to content

Commit

Permalink
fix(specs): extend Analytics descriptions (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#4360

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: gazconroy <gazconroyster@gmail.com>
Co-authored-by: Gary Conroy <gary.conroy@LON-M3P-GConroy.local>
Co-authored-by: Kai Welke <kai.welke@algolia.com>
  • Loading branch information
4 people committed Jan 16, 2025
1 parent 4460361 commit 185acea
Show file tree
Hide file tree
Showing 21 changed files with 154 additions and 90 deletions.
140 changes: 97 additions & 43 deletions Sources/Analytics/AnalyticsClient.swift

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Sources/Analytics/Models/DailyAddToCartRates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import Foundation
#endif

public struct DailyAddToCartRates: Codable, JSONEncodable {
/// Add-to-cart rate, calculated as number of tracked searches with at least one add-to-cart event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// Add-to-cart rate: calculated as the number of tracked searches with at least one add-to-cart event divided by
/// the number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var rate: Double?
/// Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
Expand Down
5 changes: 3 additions & 2 deletions Sources/Analytics/Models/DailyClickThroughRates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import Foundation
#endif

public struct DailyClickThroughRates: Codable, JSONEncodable {
/// Click-through rate, calculated as number of tracked searches with at least one click event divided by the number
/// of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true.
/// Click-through rate: calculated as the number of tracked searches with at least one click event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var rate: Double?
/// Number of clicks associated with this search.
public var clickCount: Int
Expand Down
2 changes: 1 addition & 1 deletion Sources/Analytics/Models/DailyConversionRates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation
#endif

public struct DailyConversionRates: Codable, JSONEncodable {
/// Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the
/// Conversion rate: calculated as the number of tracked searches with at least one conversion event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var rate: Double?
Expand Down
2 changes: 1 addition & 1 deletion Sources/Analytics/Models/DailyNoClickRates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation
#endif

public struct DailyNoClickRates: Codable, JSONEncodable {
/// No click rate, calculated as number of tracked searches without any click divided by the number of tracked
/// No click rate: calculated as the number of tracked searches without clicks divided by the number of tracked
/// searches.
public var rate: Double
/// Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Analytics/Models/DailyNoResultsRates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public struct DailyNoResultsRates: Codable, JSONEncodable {
public var noResultCount: Int
/// Number of searches.
public var count: Int
/// No results rate, calculated as number of searches with zero results divided by the total number of searches.
/// No results rate: calculated as the number of searches with zero results divided by the total number of searches.
public var rate: Double

public init(date: String, noResultCount: Int, count: Int, rate: Double) {
Expand Down
5 changes: 3 additions & 2 deletions Sources/Analytics/Models/DailyPurchaseRates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import Foundation
#endif

public struct DailyPurchaseRates: Codable, JSONEncodable {
/// Purchase rate, calculated as number of tracked searches with at least one purchase event divided by the number
/// of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true.
/// Purchase rate: calculated as the number of tracked searches with at least one purchase event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var rate: Double?
/// Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
public var trackedSearchCount: Int
Expand Down
2 changes: 1 addition & 1 deletion Sources/Analytics/Models/DailyRevenue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation
#endif

public struct DailyRevenue: Codable, JSONEncodable {
/// Revenue associated with this search, broken-down by currencies.
/// Revenue associated with this search: broken down by currency.
public var currencies: [String: CurrencyCode]
/// Date in the format YYYY-MM-DD.
public var date: String
Expand Down
4 changes: 2 additions & 2 deletions Sources/Analytics/Models/GetAddToCartRateResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import Foundation
#endif

public struct GetAddToCartRateResponse: Codable, JSONEncodable {
/// Add-to-cart rate, calculated as number of tracked searches with at least one add-to-cart event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// Add-to-cart rate: calculated as the number of tracked searches with at least one add-to-cart event divided by
/// the number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var rate: Double?
/// Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
Expand Down
5 changes: 3 additions & 2 deletions Sources/Analytics/Models/GetClickThroughRateResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import Foundation
#endif

public struct GetClickThroughRateResponse: Codable, JSONEncodable {
/// Click-through rate, calculated as number of tracked searches with at least one click event divided by the number
/// of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true.
/// Click-through rate: calculated as the number of tracked searches with at least one click event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var rate: Double?
/// Number of clicks associated with this search.
public var clickCount: Int
Expand Down
2 changes: 1 addition & 1 deletion Sources/Analytics/Models/GetConversionRateResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation
#endif

public struct GetConversionRateResponse: Codable, JSONEncodable {
/// Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the
/// Conversion rate: calculated as the number of tracked searches with at least one conversion event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var rate: Double?
Expand Down
2 changes: 1 addition & 1 deletion Sources/Analytics/Models/GetNoClickRateResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation
#endif

public struct GetNoClickRateResponse: Codable, JSONEncodable {
/// No click rate, calculated as number of tracked searches without any click divided by the number of tracked
/// No click rate: calculated as the number of tracked searches without clicks divided by the number of tracked
/// searches.
public var rate: Double
/// Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Analytics/Models/GetNoResultsRateResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation
#endif

public struct GetNoResultsRateResponse: Codable, JSONEncodable {
/// No results rate, calculated as number of searches with zero results divided by the total number of searches.
/// No results rate: calculated as the number of searches with zero results divided by the total number of searches.
public var rate: Double
/// Number of searches.
public var count: Int
Expand Down
5 changes: 3 additions & 2 deletions Sources/Analytics/Models/GetPurchaseRateResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import Foundation
#endif

public struct GetPurchaseRateResponse: Codable, JSONEncodable {
/// Purchase rate, calculated as number of tracked searches with at least one purchase event divided by the number
/// of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true.
/// Purchase rate: calculated as the number of tracked searches with at least one purchase event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var rate: Double?
/// Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
public var trackedSearchCount: Int
Expand Down
2 changes: 1 addition & 1 deletion Sources/Analytics/Models/GetRevenue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation
#endif

public struct GetRevenue: Codable, JSONEncodable {
/// Revenue associated with this search, broken-down by currencies.
/// Revenue associated with this search: broken down by currency.
public var currencies: [String: CurrencyCode]
/// Daily revenue.
public var dates: [DailyRevenue]
Expand Down
4 changes: 2 additions & 2 deletions Sources/Analytics/Models/GetTopFiltersNoResultsResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import Foundation
#endif

public struct GetTopFiltersNoResultsResponse: Codable, JSONEncodable {
/// Filters for searches without any results. If null, the search term specified with the `search` parameter is not
/// a search without results, or the `search` parameter is absent from the request.
/// Filters for searches without any results. If null, the search term specified with the `search` parameter isn't a
/// search without results, or the `search` parameter is absent from the request.
public var values: [GetTopFiltersNoResultsValues]?

public init(values: [GetTopFiltersNoResultsValues]?) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Analytics/Models/TopHit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation
#endif

public struct TopHit: Codable, JSONEncodable {
/// Object ID of a record that's returned as a search result.
/// Object ID of a record returned as a search result.
public var hit: String
/// Number of occurrences.
public var count: Int
Expand Down
9 changes: 5 additions & 4 deletions Sources/Analytics/Models/TopHitWithAnalytics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import Foundation
#endif

public struct TopHitWithAnalytics: Codable, JSONEncodable {
/// Object ID of a record that's returned as a search result.
/// Object ID of a record returned as a search result.
public var hit: String
/// Number of occurrences.
public var count: Int
/// Click-through rate, calculated as number of tracked searches with at least one click event divided by the number
/// of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true.
/// Click-through rate: calculated as the number of tracked searches with at least one click event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var clickThroughRate: Double?
/// Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the
/// Conversion rate: calculated as the number of tracked searches with at least one conversion event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var conversionRate: Double?
Expand Down
20 changes: 11 additions & 9 deletions Sources/Analytics/Models/TopHitWithRevenueAnalytics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import Foundation
#endif

public struct TopHitWithRevenueAnalytics: Codable, JSONEncodable {
/// Object ID of a record that's returned as a search result.
/// Object ID of a record returned as a search result.
public var hit: String
/// Number of occurrences.
public var count: Int
/// Click-through rate, calculated as number of tracked searches with at least one click event divided by the number
/// of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true.
/// Click-through rate: calculated as the number of tracked searches with at least one click event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var clickThroughRate: Double?
/// Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the
/// Conversion rate: calculated as the number of tracked searches with at least one conversion event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var conversionRate: Double?
Expand All @@ -24,18 +25,19 @@ public struct TopHitWithRevenueAnalytics: Codable, JSONEncodable {
public var clickCount: Int
/// Number of conversions from this search.
public var conversionCount: Int
/// Add-to-cart rate, calculated as number of tracked searches with at least one add-to-cart event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// Add-to-cart rate: calculated as the number of tracked searches with at least one add-to-cart event divided by
/// the number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var addToCartRate: Double?
/// Number of add-to-cart events from this search.
public var addToCartCount: Int
/// Purchase rate, calculated as number of tracked searches with at least one purchase event divided by the number
/// of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true.
/// Purchase rate: calculated as the number of tracked searches with at least one purchase event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var purchaseRate: Double?
/// Number of purchase events from this search.
public var purchaseCount: Int
/// Revenue associated with this search, broken-down by currencies.
/// Revenue associated with this search: broken down by currency.
public var currencies: [String: CurrencyCode]

public init(
Expand Down
7 changes: 4 additions & 3 deletions Sources/Analytics/Models/TopSearchWithAnalytics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ public struct TopSearchWithAnalytics: Codable, JSONEncodable {
public var search: String
/// Number of searches.
public var count: Int
/// Click-through rate, calculated as number of tracked searches with at least one click event divided by the number
/// of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true.
/// Click-through rate: calculated as the number of tracked searches with at least one click event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var clickThroughRate: Double?
/// Average position of a clicked search result in the list of search results. If null, Algolia didn't receive any
/// search requests with `clickAnalytics` set to true.
public var averageClickPosition: Double?
/// List of positions in the search results and clicks associated with this search.
public var clickPositions: [ClickPosition]
/// Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the
/// Conversion rate: calculated as the number of tracked searches with at least one conversion event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var conversionRate: Double?
Expand Down
18 changes: 10 additions & 8 deletions Sources/Analytics/Models/TopSearchWithRevenueAnalytics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ public struct TopSearchWithRevenueAnalytics: Codable, JSONEncodable {
public var search: String
/// Number of searches.
public var count: Int
/// Click-through rate, calculated as number of tracked searches with at least one click event divided by the number
/// of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true.
/// Click-through rate: calculated as the number of tracked searches with at least one click event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var clickThroughRate: Double?
/// Average position of a clicked search result in the list of search results. If null, Algolia didn't receive any
/// search requests with `clickAnalytics` set to true.
public var averageClickPosition: Double?
/// List of positions in the search results and clicks associated with this search.
public var clickPositions: [ClickPosition]
/// Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the
/// Conversion rate: calculated as the number of tracked searches with at least one conversion event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var conversionRate: Double?
Expand All @@ -31,16 +32,17 @@ public struct TopSearchWithRevenueAnalytics: Codable, JSONEncodable {
public var conversionCount: Int
/// Number of results (hits).
public var nbHits: Int
/// Revenue associated with this search, broken-down by currencies.
/// Revenue associated with this search: broken down by currency.
public var currencies: [String: CurrencyCode]
/// Add-to-cart rate, calculated as number of tracked searches with at least one add-to-cart event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// Add-to-cart rate: calculated as the number of tracked searches with at least one add-to-cart event divided by
/// the number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var addToCartRate: Double?
/// Number of add-to-cart events from this search.
public var addToCartCount: Int
/// Purchase rate, calculated as number of tracked searches with at least one purchase event divided by the number
/// of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true.
/// Purchase rate: calculated as the number of tracked searches with at least one purchase event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
public var purchaseRate: Double?
/// Number of purchase events from this search.
public var purchaseCount: Int
Expand Down

0 comments on commit 185acea

Please sign in to comment.