Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit e31aad7

Browse files
authored
Addressed an issue with requesting products. (#108)
* Addressed an issue with requesting products. * Updated the release notes * Added the other support catalog types.
1 parent 612737a commit e31aad7

14 files changed

Lines changed: 43 additions & 20 deletions

ChangeLog.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
2020

2121
# Change Log
2222

23-
## Upcoming Release
23+
## 1.5.1903.6
24+
25+
* Products
26+
* Addressed an issue with requesting products
27+
28+
## 1.5.1903.5
2429

2530
* Auditing
2631
* Added new operation and resource types

docs/help/Get-PartnerProduct.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ A string that the product catalog.
4545
Type: String
4646
Parameter Sets: ByCatalog
4747
Aliases:
48-
Accepted values: Azure, OnlineServices, Software
48+
Accepted values: Azure, AzureReservations, AzureReservationsVM, AzureReservationsSQL, AzureReservationsCosmosDb, OnlineServices, Software, SoftwareSUSELinux, SoftwarePerpetual, SoftwareSubscriptions
4949

5050
Required: True
5151
Position: Named

src/PartnerCenter.TestFramework/PartnerCenter.TestFramework.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<PackageProjectUrl>https://github.com/Microsoft/Partner-Center-PowerShell</PackageProjectUrl>
1313
<RepositoryUrl>https://github.com/Microsoft/Partner-Center-PowerShell.git</RepositoryUrl>
1414
<RepositoryType>git</RepositoryType>
15-
<Version>1.5.1903.5</Version>
15+
<Version>1.5.1903.6</Version>
1616
<NeutralLanguage>en-US</NeutralLanguage>
1717
</PropertyGroup>
1818

src/PartnerCenter/Models/JsonConverters/EnumJsonConverter.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Microsoft.Store.PartnerCenter.Models.JsonConverters
88
{
99
using System;
10+
using Extensions;
1011
using System.Globalization;
1112
using System.Text;
1213
using Newtonsoft.Json;
@@ -41,6 +42,18 @@ public override bool CanConvert(Type objectType)
4142
/// <returns>The object that represents the serialized JSON.</returns>
4243
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
4344
{
45+
reader.AssertNotNull(nameof(reader));
46+
objectType.AssertNotNull(nameof(objectType));
47+
48+
if (!objectType.IsEnum)
49+
{
50+
throw new JsonSerializationException(
51+
string.Format(
52+
CultureInfo.InvariantCulture,
53+
"EnumJsonConverter cannot deserialize '{0}' values",
54+
objectType.Name));
55+
}
56+
4457
if (reader.TokenType == JsonToken.String)
4558
{
4659
return Enum.Parse(objectType, JScriptToPascalCase(reader.Value.ToString()));
@@ -49,8 +62,10 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
4962
{
5063
return Enum.ToObject(objectType, reader.Value);
5164
}
52-
53-
throw new NotImplementedException();
65+
else
66+
{
67+
throw new JsonSerializationException(string.Format(CultureInfo.InvariantCulture, "EnumJsonConverter cannot deserialize '{0}' values", reader.TokenType));
68+
}
5469
}
5570

5671
/// <summary>

src/PartnerCenter/PartnerCenter.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Copyright>Copyright © 2019</Copyright>
1010
<NeutralLanguage>en-US</NeutralLanguage>
1111
<Product>Microsoft Partner Center</Product>
12-
<Version>1.5.1903.5</Version>
12+
<Version>1.5.1903.6</Version>
1313
<PackageLicenseUrl>https://github.com/Microsoft/Partner-Center-PowerShell/blob/master/LICENSE</PackageLicenseUrl>
1414
<PackageProjectUrl>https://github.com/Microsoft/Partner-Center-PowerShell</PackageProjectUrl>
1515
<RepositoryUrl>https://github.com/Microsoft/Partner-Center-PowerShell.git</RepositoryUrl>

src/PartnerCenter/Products/ProductCollectionByCountryByTargetViewByTargetSegmentOperations.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ namespace Microsoft.Store.PartnerCenter.Products
1717

1818
internal class ProductCollectionByCountryByTargetViewByTargetSegmentOperations : BasePartnerComponent<Tuple<string, string, string>>, IProductCollectionByCountryByTargetViewByTargetSegment
1919
{
20-
2120
/// <summary>
2221
/// Initializes a new instance of the <see cref="ProductCollectionByCountryByTargetViewByTargetSegmentOperations" /> class.
2322
/// </summary>

src/PartnerCenter/Products/ProductCollectionByCountryByTargetViewOperations.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ public ProductCollectionByCountryByTargetViewOperations(IPartner rootPartnerOper
4040
/// <returns>The product collection operations by country, by target view and by target segment.</returns>
4141
public IProductCollectionByCountryByTargetViewByTargetSegment ByTargetSegment(string targetSegment)
4242
{
43-
throw new NotImplementedException();
43+
return new ProductCollectionByCountryByTargetViewByTargetSegmentOperations(
44+
Partner,
45+
Context.Item1,
46+
Context.Item2,
47+
targetSegment);
4448
}
4549

4650
/// <summary>
@@ -57,7 +61,7 @@ public async Task<ResourceCollection<Product>> GetAsync(CancellationToken cancel
5761
Context.Item2
5862
},
5963
{
60-
PartnerService.Instance.Configuration.Apis.GetProducts.Parameters.TargetSegment,
64+
PartnerService.Instance.Configuration.Apis.GetProducts.Parameters.TargetView,
6165
Context.Item1
6266
}
6367
};

src/PowerShell/Commands/GetPartnerProduct.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class GetPartnerProduct : PartnerPSCmdlet
3838
/// Gets or sets the product catalog.
3939
/// </summary>
4040
[Parameter(ParameterSetName = "ByCatalog", Mandatory = true, HelpMessage = "A string that the product catalog.")]
41-
[ValidateSet("Azure", "OnlineServices", "Software")]
41+
[ValidateSet("Azure", "AzureReservations", "AzureReservationsVM", "AzureReservationsSQL", "AzureReservationsCosmosDb", "OnlineServices", "Software", "SoftwareSUSELinux", "SoftwarePerpetual", "SoftwareSubscriptions")]
4242
public string Catalog { get; set; }
4343

4444
/// <summary>

src/PowerShell/PartnerCenter.NetCore.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 03/15/2019
6+
# Generated on: 03/25/2019
77
#
88

99
@{
1010
# Script module or binary module file associated with this manifest.
1111
RootModule = 'Microsoft.Store.PartnerCenter.PowerShell.dll'
1212

1313
# Version number of this module.
14-
ModuleVersion = '1.5.1903.1'
14+
ModuleVersion = '1.5.1903.6'
1515

1616
# Supported PSEditions
1717
CompatiblePSEditions = 'Core', 'Desktop'
@@ -200,7 +200,7 @@
200200
# IconUri = ''
201201

202202
# ReleaseNotes of this module
203-
ReleaseNotes = 'Added commands to manage application consents.'
203+
ReleaseNotes = ''
204204

205205
# Prerelease string of this module
206206
# Prerelease = 'preview'

src/PowerShell/PartnerCenter.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 03/15/2019
6+
# Generated on: 03/25/2019
77
#
88

99
@{
1010
# Script module or binary module file associated with this manifest.
1111
RootModule = 'Microsoft.Store.PartnerCenter.PowerShell.dll'
1212

1313
# Version number of this module.
14-
ModuleVersion = '1.5.1903.1'
14+
ModuleVersion = '1.5.1903.6'
1515

1616
# Supported PSEditions
1717
# CompatiblePSEditions = @()
@@ -201,7 +201,7 @@
201201
# IconUri = ''
202202

203203
# ReleaseNotes of this module
204-
ReleaseNotes = 'Added commands to manage application consents.'
204+
ReleaseNotes = ''
205205

206206
# Prerelease string of this module
207207
# Prerelease = 'preview'

0 commit comments

Comments
 (0)