Merge pull request #41 from microsoft/brmontic/removeResourceUsage

Brmontic/remove resource usage
This commit is contained in:
Brian D. Monticello 2019-11-08 12:46:47 -08:00 коммит произвёл GitHub
Родитель c70830ea0a 1c6be2a6e2
Коммит 0ded2e2582
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 7 добавлений и 49 удалений

Просмотреть файл

@ -374,7 +374,6 @@ namespace Microsoft.Store.PartnerCenter.Samples
{
new GetCustomerUsageSummary(context),
new GetCustomerSubscriptionsUsage(context),
new GetSubscriptionResourceUsage(context),
new GetSubscriptionUsageRecords(context),
new GetSubscriptionUsageSummary(context)
};

Просмотреть файл

@ -1,40 +0,0 @@
// -----------------------------------------------------------------------
// <copyright file="GetSubscriptionResourceUsage.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------
namespace Microsoft.Store.PartnerCenter.Samples.RatedUsage
{
/// <summary>
/// A scenario that retrieves a single subscription's resource usage records.
/// </summary>
public class GetSubscriptionResourceUsage : BasePartnerScenario
{
/// <summary>
/// Initializes a new instance of the <see cref="GetSubscriptionResourceUsage"/> class.
/// </summary>
/// <param name="context">The scenario context.</param>
public GetSubscriptionResourceUsage(IScenarioContext context) : base("Get subscription resource usage", context)
{
}
/// <summary>
/// Executes the scenario.
/// </summary>
protected override void RunScenario()
{
var partnerOperations = this.Context.UserPartnerOperations;
string customerId = this.ObtainCustomerId("Enter the ID of the customer who owns the subscription");
string subscriptionId = this.ObtainSubscriptionId(customerId, "Enter the subscription ID");
this.Context.ConsoleHelper.StartProgress("Retrieving customer orders");
var usageRecords = partnerOperations.Customers.ById(customerId).Subscriptions.ById(subscriptionId).UsageRecords.Resources.Get();
this.Context.ConsoleHelper.StopProgress();
this.Context.ConsoleHelper.WriteObject(usageRecords, "Subscription resource usage records");
}
}
}

Просмотреть файл

@ -45,14 +45,14 @@
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.0\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Store.PartnerCenter, Version=1.14.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Store.PartnerCenter.1.14.0\lib\Net45\Microsoft.Store.PartnerCenter.dll</HintPath>
<Reference Include="Microsoft.Store.PartnerCenter, Version=1.15.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Store.PartnerCenter.1.15.1\lib\Net45\Microsoft.Store.PartnerCenter.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Store.PartnerCenter.Extensions, Version=1.14.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Store.PartnerCenter.1.14.0\lib\Net45\Microsoft.Store.PartnerCenter.Extensions.dll</HintPath>
<Reference Include="Microsoft.Store.PartnerCenter.Extensions, Version=1.15.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Store.PartnerCenter.1.15.1\lib\Net45\Microsoft.Store.PartnerCenter.Extensions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Store.PartnerCenter.Models, Version=1.14.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Store.PartnerCenter.1.14.0\lib\Net45\Microsoft.Store.PartnerCenter.Models.dll</HintPath>
<Reference Include="Microsoft.Store.PartnerCenter.Models, Version=1.15.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Store.PartnerCenter.1.15.1\lib\Net45\Microsoft.Store.PartnerCenter.Models.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
@ -227,7 +227,6 @@
<Compile Include="RateCards\GetAzureRateCard.cs" />
<Compile Include="RateCards\GetAzureSharedRateCard.cs" />
<Compile Include="RatedUsage\GetCustomerSubscriptionsUsage.cs" />
<Compile Include="RatedUsage\GetSubscriptionResourceUsage.cs" />
<Compile Include="RatedUsage\GetCustomerUsageSummary.cs" />
<Compile Include="ScenarioExecution\PromptExecutionStrategy.cs" />
<Compile Include="ScenarioExecution\AggregateScenarioExecutionStrategy.cs" />

Просмотреть файл

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="5.2.0" targetFramework="net461" />
<package id="Microsoft.Store.PartnerCenter" version="1.14.0" targetFramework="net461" />
<package id="Microsoft.Store.PartnerCenter" version="1.15.1" targetFramework="net461" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net461" />
<package id="System.Net.Http" version="4.3.4" targetFramework="net461" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net461" />