Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Generator/Generator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ItemGroup>
<PackageReference Include="AngleSharp.Xml" Version="1.0.0" />
<PackageReference Include="Relewise.Client" Version="1.249.0" />
<PackageReference Include="Relewise.Client" Version="1.259.0" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions Generator/Generator.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=Relewise/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
10 changes: 5 additions & 5 deletions Generator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@

var phpClientWriter = new PhpClientWriter(phpWriter);

phpClientWriter.GenerateClientClass(typeof(Tracker), new[] { "Track" });
phpClientWriter.GenerateClientClass(typeof(Searcher), new[] { "Search", "Predict", "Batch" });
phpClientWriter.GenerateClientClass(typeof(Recommender), new[] { "Recommend" });
phpClientWriter.GenerateClientClass(typeof(SearchAdministrator), new[] { "Delete", "Save", "Load" });
phpClientWriter.GenerateClientClass(typeof(Analyzer), new[] { "Analyze" });
phpClientWriter.GenerateClientClass(typeof(Tracker), ["Track"]);
phpClientWriter.GenerateClientClass(typeof(Searcher), ["Search", "Predict", "Batch"]);
phpClientWriter.GenerateClientClass(typeof(Recommender), ["Recommend"]);
phpClientWriter.GenerateClientClass(typeof(SearchAdministrator), ["Delete", "Save", "Load"]);
phpClientWriter.GenerateClientClass(typeof(Analyzer), ["Analyze"]);

if (phpWriter.MissingTypeDefinitions.Count > 0)
{
Expand Down
18 changes: 9 additions & 9 deletions src/Models/CampaignAnalyticsDisplayAdAnalyticsPeriodMetrics.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class CampaignAnalyticsDisplayAdAnalyticsPeriodMetrics implements JsonSerializab
{
public string $typeDefinition = "Relewise.Client.DataTypes.RetailMedia.CampaignAnalytics+DisplayAdAnalytics+PeriodMetrics, Relewise.Client";
public DateTime $periodFromUtc;
public int $views;
public int $promotions;
public int $clicks;

public static function create(DateTime $periodFromUtc, int $views, int $clicks) : CampaignAnalyticsDisplayAdAnalyticsPeriodMetrics
public static function create(DateTime $periodFromUtc, int $promotions, int $clicks) : CampaignAnalyticsDisplayAdAnalyticsPeriodMetrics
{
$result = new CampaignAnalyticsDisplayAdAnalyticsPeriodMetrics();
$result->periodFromUtc = $periodFromUtc;
$result->views = $views;
$result->promotions = $promotions;
$result->clicks = $clicks;
return $result;
}
Expand All @@ -28,9 +28,9 @@ public static function hydrate(array $arr) : CampaignAnalyticsDisplayAdAnalytics
{
$result->periodFromUtc = new DateTime($arr["periodFromUtc"]);
}
if (array_key_exists("views", $arr))
if (array_key_exists("promotions", $arr))
{
$result->views = $arr["views"];
$result->promotions = $arr["promotions"];
}
if (array_key_exists("clicks", $arr))
{
Expand All @@ -45,9 +45,9 @@ function setPeriodFromUtc(DateTime $periodFromUtc)
return $this;
}

function setViews(int $views)
function setPromotions(int $promotions)
{
$this->views = $views;
$this->promotions = $promotions;
return $this;
}

Expand All @@ -65,9 +65,9 @@ public function jsonSerialize(): mixed
{
$result["periodFromUtc"] = $this->periodFromUtc->format(DATE_ATOM);
}
if (isset($this->views))
if (isset($this->promotions))
{
$result["views"] = $this->views;
$result["promotions"] = $this->promotions;
}
if (isset($this->clicks))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class CampaignAnalyticsDisplayAdAnalyticsPromotedDisplayAdMetrics
public int $promotions;
public int $lastClickedUnixMinutes;
public int $numberOfTimesClicked;
public DisplayAdResult $displayAd;

public static function create(string $displayAdId, int $promotions, int $lastClickedUnixMinutes, int $numberOfTimesClicked) : CampaignAnalyticsDisplayAdAnalyticsPromotedDisplayAdMetrics
{
Expand Down Expand Up @@ -39,6 +40,10 @@ public static function hydrate(array $arr) : CampaignAnalyticsDisplayAdAnalytics
{
$result->numberOfTimesClicked = $arr["numberOfTimesClicked"];
}
if (array_key_exists("displayAd", $arr))
{
$result->displayAd = DisplayAdResult::hydrate($arr["displayAd"]);
}
return $result;
}

Expand All @@ -65,4 +70,10 @@ function setNumberOfTimesClicked(int $numberOfTimesClicked)
$this->numberOfTimesClicked = $numberOfTimesClicked;
return $this;
}

function setDisplayAd(DisplayAdResult $displayAd)
{
$this->displayAd = $displayAd;
return $this;
}
}
18 changes: 17 additions & 1 deletion src/Models/CampaignAnalyticsProductAnalyticsPeriodMetrics.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ class CampaignAnalyticsProductAnalyticsPeriodMetrics implements JsonSerializable
public int $views;
public int $salesQuantity;
public array $currencies;
public int $promotions;

public static function create(DateTime $periodFromUtc, int $views, int $salesQuantity, CampaignAnalyticsProductAnalyticsPeriodMetricsCurrencyMetrics ... $currencies) : CampaignAnalyticsProductAnalyticsPeriodMetrics
public static function create(DateTime $periodFromUtc, int $views, int $salesQuantity, array $currencies, int $promotions) : CampaignAnalyticsProductAnalyticsPeriodMetrics
{
$result = new CampaignAnalyticsProductAnalyticsPeriodMetrics();
$result->periodFromUtc = $periodFromUtc;
$result->views = $views;
$result->salesQuantity = $salesQuantity;
$result->currencies = $currencies;
$result->promotions = $promotions;
return $result;
}

Expand All @@ -46,6 +48,10 @@ public static function hydrate(array $arr) : CampaignAnalyticsProductAnalyticsPe
array_push($result->currencies, CampaignAnalyticsProductAnalyticsPeriodMetricsCurrencyMetrics::hydrate($value));
}
}
if (array_key_exists("promotions", $arr))
{
$result->promotions = $arr["promotions"];
}
return $result;
}

Expand Down Expand Up @@ -90,6 +96,12 @@ function addToCurrencies(CampaignAnalyticsProductAnalyticsPeriodMetricsCurrencyM
return $this;
}

function setPromotions(int $promotions)
{
$this->promotions = $promotions;
return $this;
}

public function jsonSerialize(): mixed
{
$result = array();
Expand All @@ -110,6 +122,10 @@ public function jsonSerialize(): mixed
{
$result["currencies"] = $this->currencies;
}
if (isset($this->promotions))
{
$result["promotions"] = $this->promotions;
}
return $result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class CampaignAnalyticsProductAnalyticsPromotedProductMetrics
public string $typeDefinition = "Relewise.Client.DataTypes.RetailMedia.CampaignAnalytics+ProductAnalytics+PromotedProductMetrics, Relewise.Client";
public string $productId;
public int $promotions;
public ProductResult $product;

public static function create(string $productId, int $promotions) : CampaignAnalyticsProductAnalyticsPromotedProductMetrics
{
Expand All @@ -27,6 +28,10 @@ public static function hydrate(array $arr) : CampaignAnalyticsProductAnalyticsPr
{
$result->promotions = $arr["promotions"];
}
if (array_key_exists("product", $arr))
{
$result->product = ProductResult::hydrate($arr["product"]);
}
return $result;
}

Expand All @@ -41,4 +46,10 @@ function setPromotions(int $promotions)
$this->promotions = $promotions;
return $this;
}

function setProduct(ProductResult $product)
{
$this->product = $product;
return $this;
}
}
44 changes: 44 additions & 0 deletions src/Models/CampaignAnalyticsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ class CampaignAnalyticsRequest extends LicensedRequest
public DateTimeRange $periodUtc;
public ?FilterCollection $productFilters;
public ?FilterCollection $displayAdFilters;
public ?Language $language;
public ?Currency $currency;
public ?SelectedProductPropertiesSettings $selectedProductProperties;
public ?SelectedDisplayAdPropertiesSettings $selectedDisplayAdProperties;

public static function create(string $id, DateTimeRange $periodUtc, ?FilterCollection $productFilters, ?FilterCollection $displayAdFilters) : CampaignAnalyticsRequest
{
Expand Down Expand Up @@ -41,6 +45,22 @@ public static function hydrate(array $arr) : CampaignAnalyticsRequest
{
$result->displayAdFilters = FilterCollection::hydrate($arr["displayAdFilters"]);
}
if (array_key_exists("language", $arr))
{
$result->language = Language::hydrate($arr["language"]);
}
if (array_key_exists("currency", $arr))
{
$result->currency = Currency::hydrate($arr["currency"]);
}
if (array_key_exists("selectedProductProperties", $arr))
{
$result->selectedProductProperties = SelectedProductPropertiesSettings::hydrate($arr["selectedProductProperties"]);
}
if (array_key_exists("selectedDisplayAdProperties", $arr))
{
$result->selectedDisplayAdProperties = SelectedDisplayAdPropertiesSettings::hydrate($arr["selectedDisplayAdProperties"]);
}
return $result;
}

Expand Down Expand Up @@ -68,4 +88,28 @@ function setDisplayAdFilters(?FilterCollection $displayAdFilters)
$this->displayAdFilters = $displayAdFilters;
return $this;
}

function setLanguage(?Language $language)
{
$this->language = $language;
return $this;
}

function setCurrency(?Currency $currency)
{
$this->currency = $currency;
return $this;
}

function setSelectedProductProperties(?SelectedProductPropertiesSettings $selectedProductProperties)
{
$this->selectedProductProperties = $selectedProductProperties;
return $this;
}

function setSelectedDisplayAdProperties(?SelectedDisplayAdPropertiesSettings $selectedDisplayAdProperties)
{
$this->selectedDisplayAdProperties = $selectedDisplayAdProperties;
return $this;
}
}
33 changes: 33 additions & 0 deletions src/Models/CategoryIndexConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

class CategoryIndexConfiguration
{
/** Default configuration entry used when no specific category scope is specified. This serves as the fallback configuration for category indexing operations. */
public CategoryIndexConfigurationEntry $unspecified;
/** Scope-specific configuration entries mapped by CategoryScope enum values. Allows different indexing configurations for different category relationship scopes (e.g., ImmediateParent, ImmediateParentOrItsParent, Ancestor). When null, only the Unspecified configuration will be used. */
public ?array $byScope;

public static function create() : CategoryIndexConfiguration
{
Expand All @@ -19,12 +22,42 @@ public static function hydrate(array $arr) : CategoryIndexConfiguration
{
$result->unspecified = CategoryIndexConfigurationEntry::hydrate($arr["unspecified"]);
}
if (array_key_exists("byScope", $arr))
{
$result->byScope = array();
foreach($arr["byScope"] as $key => $value)
{
$result->byScope[CategoryScope::from($key)] = CategoryIndexConfigurationEntry::hydrate($value);
}
}
return $result;
}

/** Default configuration entry used when no specific category scope is specified. This serves as the fallback configuration for category indexing operations. */
function setUnspecified(CategoryIndexConfigurationEntry $unspecified)
{
$this->unspecified = $unspecified;
return $this;
}

/** Scope-specific configuration entries mapped by CategoryScope enum values. Allows different indexing configurations for different category relationship scopes (e.g., ImmediateParent, ImmediateParentOrItsParent, Ancestor). When null, only the Unspecified configuration will be used. */
function addToByScope(CategoryScope $key, CategoryIndexConfigurationEntry $value)
{
if (!isset($this->byScope))
{
$this->byScope = array();
}
$this->byScope[$key] = $value;
return $this;
}

/**
* Scope-specific configuration entries mapped by CategoryScope enum values. Allows different indexing configurations for different category relationship scopes (e.g., ImmediateParent, ImmediateParentOrItsParent, Ancestor). When null, only the Unspecified configuration will be used.
* @param ?array<CategoryScope, CategoryIndexConfigurationEntry> $byScope associative array.
*/
function setByScopeFromAssociativeArray(array $byScope)
{
$this->byScope = $byScope;
return $this;
}
}
13 changes: 0 additions & 13 deletions src/Models/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ class Location extends LocationEntityStatestringLocationMetadataValuesRetailMedi
public ?string $key;
/** The placements where promotions may be displayed at this location If null or empty, no promotions will be shown at this location */
public ?LocationPlacementCollection $placements;
/** Defines what kinds of promotions are supported by this location */
public ?PromotionSpecificationCollection $supportedPromotions;

public static function create(?string $id, LocationEntityState $state, string $name) : Location
{
Expand All @@ -39,10 +37,6 @@ public static function hydrate(array $arr) : Location
{
$result->placements = LocationPlacementCollection::hydrate($arr["placements"]);
}
if (array_key_exists("supportedPromotions", $arr))
{
$result->supportedPromotions = PromotionSpecificationCollection::hydrate($arr["supportedPromotions"]);
}
return $result;
}

Expand All @@ -67,13 +61,6 @@ function setPlacements(?LocationPlacementCollection $placements)
return $this;
}

/** Defines what kinds of promotions are supported by this location */
function setSupportedPromotions(?PromotionSpecificationCollection $supportedPromotions)
{
$this->supportedPromotions = $supportedPromotions;
return $this;
}

function setState(LocationEntityState $state)
{
$this->state = $state;
Expand Down
25 changes: 25 additions & 0 deletions src/Models/ProductCategoryIndexConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ public static function hydrate(array $arr) : ProductCategoryIndexConfiguration
{
$result->unspecified = CategoryIndexConfigurationEntry::hydrate($arr["unspecified"]);
}
if (array_key_exists("byScope", $arr))
{
$result->byScope = array();
foreach($arr["byScope"] as $key => $value)
{
$result->byScope[CategoryScope::from($key)] = CategoryIndexConfigurationEntry::hydrate($value);
}
}
return $result;
}

Expand All @@ -26,4 +34,21 @@ function setUnspecified(CategoryIndexConfigurationEntry $unspecified)
$this->unspecified = $unspecified;
return $this;
}

function addToByScope(CategoryScope $key, CategoryIndexConfigurationEntry $value)
{
if (!isset($this->byScope))
{
$this->byScope = array();
}
$this->byScope[$key] = $value;
return $this;
}

/** @param ?array<CategoryScope, CategoryIndexConfigurationEntry> $byScope associative array. */
function setByScopeFromAssociativeArray(array $byScope)
{
$this->byScope = $byScope;
return $this;
}
}
4 changes: 0 additions & 4 deletions src/Models/PromotionSpecification.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ abstract class PromotionSpecification
public static function hydrate(array $arr)
{
$type = $arr["\$type"];
if ($type=="Relewise.Client.DataTypes.RetailMedia.DisplayAdPromotion+Specification, Relewise.Client")
{
return DisplayAdPromotionSpecification::hydrate($arr);
}
if ($type=="Relewise.Client.DataTypes.RetailMedia.ProductPromotion+Specification, Relewise.Client")
{
return ProductPromotionSpecification::hydrate($arr);
Expand Down
Loading