Skip to content

Commit

Permalink
Merge branch 'master' into feature/updateApiVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
markcowl authored Oct 8, 2019
2 parents c076625 + 73a12b1 commit 5072ee3
Show file tree
Hide file tree
Showing 113 changed files with 47,564 additions and 1,392 deletions.
9 changes: 0 additions & 9 deletions .azure-pipelines/powershell-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ jobs:
windows:
OSName: ${{ variables.WindowsName }}
ImageName: ${{ variables.WindowsImage }}
linux:
OSName: ${{ variables.LinuxName }}
ImageName: ${{ variables.LinuxImage }}
macOS:
OSName: ${{ variables.MacOSName }}
ImageName: ${{ variables.MacOSImage }}
Expand All @@ -43,9 +40,6 @@ jobs:
windows:
OSName: ${{ variables.WindowsName }}
ImageName: ${{ variables.WindowsImage }}
linux:
OSName: ${{ variables.LinuxName }}
ImageName: ${{ variables.LinuxImage }}
macOS:
OSName: ${{ variables.MacOSName }}
ImageName: ${{ variables.MacOSImage }}
Expand All @@ -68,9 +62,6 @@ jobs:
windows:
OSName: ${{ variables.WindowsName }}
ImageName: ${{ variables.WindowsImage }}
linux:
OSName: ${{ variables.LinuxName }}
ImageName: ${{ variables.LinuxImage }}
macOS:
OSName: ${{ variables.MacOSName }}
ImageName: ${{ variables.MacOSImage }}
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/az-module-bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Az module bug report
about: Report errors or unexpected behaviors for the Az module
title: ''
labels: ''
labels: triage
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/az-preview-bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Az 4.x preview bug report
about: Report errors or unexpected behaviors specifically for the Az 4.0 module in preview
title: ''
labels: 'Az 4.x Preview', 'Azure PS Team'
labels: Az 4.x Preview, Azure PS Team, triage
assignees: ''
---

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: Suggest a new feature or improvement
title: ''
labels: Azure PS Team, Feature Request
labels: Azure PS Team, Feature Request, triage
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/internal-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Internal issue
about: Azure PowerShell team only
title: ''
labels: Azure PS Team
labels: Azure PS Team, triage
assignees: ''

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.HealthcareApis" Version="1.0.1-preview" />
<PackageReference Include="Microsoft.Azure.Management.HealthcareApis" Version="1.0.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\HealthcareApis\HealthcareApis.csproj" />
</ItemGroup>



</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function Test-AzRmHealthcareApisService{

# Assert
Assert-AreEqual $actual.Name $rname
Assert-AreEqual $actual.Properties.CosmosDbConfiguration.OfferThroughput $offerThroughput
Assert-AreEqual $actual.CosmosDbOfferThroughput $offerThroughput
Assert-AreEqual $actual.Kind $kind
#Update using parameters
$newOfferThroughput = $offerThroughput - 600
Expand All @@ -55,7 +55,7 @@ function Test-AzRmHealthcareApisService{
$updatedAccount = Get-AzHealthcareApisService -ResourceGroupName $rgname -Name $rname
# Assert the update
Assert-AreEqual $updatedAccount.Name $rname
Assert-AreEqual $updatedAccount.Properties.CosmosDbConfiguration.OfferThroughput $newOfferThroughput
Assert-AreEqual $updatedAccount.CosmosDbOfferThroughput $newOfferThroughput

$rname1 = $rname + "1"
$created1 = New-AzHealthcareApisService -Name $rname1 -ResourceGroupName $rgname -Location $location -AccessPolicyObjectId $object_id -CosmosOfferThroughput $offerThroughput;
Expand All @@ -64,7 +64,7 @@ function Test-AzRmHealthcareApisService{

# Assert
Assert-AreEqual $actual1.Name $rname1
Assert-AreEqual $actual1.Properties.CosmosDbConfiguration.OfferThroughput $offerThroughput
Assert-AreEqual $actual1.CosmosDbOfferThroughput $offerThroughput

$list = Get-AzHealthcareApisService -ResourceGroupName $rgname

Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/HealthcareApis/HealthcareApis/Az.HealthcareApis.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ PrivateData = @{
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '* Added Exception Handling around KeyNotFoundException'
ReleaseNotes = '* Updated Powershell to latst version of SDK.'

# Prerelease string of this module
# Prerelease = ''
Expand Down
6 changes: 5 additions & 1 deletion src/HealthcareApis/HealthcareApis/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@
- Additional information about change #1
-->
## Upcoming Release
* Exception Handling
* Updated the powershell version to 1.0.0
* Updated the SDK version to 1.0.2
* Update in tests to refer to new SDK version
* Updated the output structure from nested to flattened.

## Version 0.1.2
* Added Exception Handling around KeyNotFoundException


## Version 0.1.1
* Added Error Handling in all cmdlets
* Fixed few typos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,11 @@ protected void WriteHealthcareApisAccount(ServicesDescription healthcareApisAcco
{
if (healthcareApisAccount != null)
{
WriteObject(PSHealthcareApisService.Create(healthcareApisAccount));
PSHealthcareApisService value = PSHealthcareApisService.Create(healthcareApisAccount);
WriteObject(value);
}
}

protected void WriteHealthcareApisAccountList(
IEnumerable<ServicesDescription> healthcareApisAccounts)
{
List<PSHealthcareApisService> output = new List<PSHealthcareApisService>();
if (healthcareApisAccounts != null)
{
healthcareApisAccounts.ForEach(
healthcareApisAccount => output.Add(PSHealthcareApisService.Create(healthcareApisAccount)));
}

WriteObject(output, true);
}

protected bool ValidateAndExtractName(string resourceId, out string resourceGroupName, out string resourceName)
{
ResourceIdentifier resourceIdentifier = new ResourceIdentifier(resourceId);
Expand Down
2 changes: 1 addition & 1 deletion src/HealthcareApis/HealthcareApis/HealthcareApis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Import Project="$(MSBuildThisFileDirectory)..\..\Az.props" />

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.HealthcareApis" Version="1.0.1-preview" />
<PackageReference Include="Microsoft.Azure.Management.HealthcareApis" Version="1.0.2" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class GetAzureRmHealthcareApisService : HealthcareApisBaseCmdlet
[Parameter(
Mandatory = false,
ParameterSetName = ListParameterSet,
HelpMessage = "Resource Group Name.")]
HelpMessage = "Resource Group Name.")]
[ResourceGroupCompleter]
[ValidateNotNullOrEmpty]
public string ResourceGroupName { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private List<ServiceAccessPolicyEntry> GetAccessPolicies()

private Kind GetKind()
{
if(this.Kind == null && this.FhirVersion!=null)
if (this.Kind == null && this.FhirVersion != null)
{
if (FhirVersion.ToLowerInvariant() == "r4")
{
Expand All @@ -241,11 +241,11 @@ private Kind GetKind()
throw new PSArgumentException(Resources.createService_InvalidFhirVersionMessage);
}
}
else if(this.Kind== null && this.FhirVersion == null)
else if (this.Kind == null && this.FhirVersion == null)
{
return Management.HealthcareApis.Models.Kind.FhirR4;
}
else if(this.FhirVersion != null)
else if (this.FhirVersion != null)
{
return ParseKindFromVersion(this.FhirVersion);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,22 @@ public class SetAzureRmHealthcareApisService : HealthcareApisBaseCmdlet
[ValidateNotNullOrEmpty]
public string[] CorsOrigin { get; set; }

[Parameter(Mandatory = false,ParameterSetName = ServiceNameParameterSet, HelpMessage = "HealthcareApis FhirService List of Cors Headers. Specify HTTP headers which can be used during the request. Use \" * \" for any header.")]
[Parameter(Mandatory = false,ParameterSetName = ResourceIdParameterSet, HelpMessage = "HealthcareApis FhirService List of Cors Headers. Specify HTTP headers which can be used during the request. Use \" * \" for any header.")]
[Parameter(Mandatory = false, ParameterSetName = ServiceNameParameterSet, HelpMessage = "HealthcareApis FhirService List of Cors Headers. Specify HTTP headers which can be used during the request. Use \" * \" for any header.")]
[Parameter(Mandatory = false, ParameterSetName = ResourceIdParameterSet, HelpMessage = "HealthcareApis FhirService List of Cors Headers. Specify HTTP headers which can be used during the request. Use \" * \" for any header.")]
[ValidateNotNullOrEmpty]
public string[] CorsHeader { get; set; }

[Parameter(Mandatory = false, ParameterSetName = ServiceNameParameterSet,HelpMessage = "HealthcareApis FhirService List of Cors Methods.")]
[Parameter(Mandatory = false,ParameterSetName = ResourceIdParameterSet,HelpMessage = "HealthcareApis FhirService List of Cors Methods.")]
[Parameter(Mandatory = false, ParameterSetName = ServiceNameParameterSet, HelpMessage = "HealthcareApis FhirService List of Cors Methods.")]
[Parameter(Mandatory = false, ParameterSetName = ResourceIdParameterSet, HelpMessage = "HealthcareApis FhirService List of Cors Methods.")]
[ValidateNotNullOrEmpty]
public string[] CorsMethod { get; set; }

[Parameter(Mandatory = false,ParameterSetName = ServiceNameParameterSet,HelpMessage = "HealthcareApis FhirService Cors Max Age. Specify how long a result from a request can be cached in seconds. Example: 600 means 10 minutes.")]
[Parameter(Mandatory = false,ParameterSetName = ResourceIdParameterSet,HelpMessage = "HealthcareApis FhirService Cors Max Age. Specify how long a result from a request can be cached in seconds. Example: 600 means 10 minutes.")]
[Parameter(Mandatory = false, ParameterSetName = ServiceNameParameterSet, HelpMessage = "HealthcareApis FhirService Cors Max Age. Specify how long a result from a request can be cached in seconds. Example: 600 means 10 minutes.")]
[Parameter(Mandatory = false, ParameterSetName = ResourceIdParameterSet, HelpMessage = "HealthcareApis FhirService Cors Max Age. Specify how long a result from a request can be cached in seconds. Example: 600 means 10 minutes.")]
[ValidateNotNullOrEmpty]
public int? CorsMaxAge { get; set; }

[Parameter(Mandatory = false,ParameterSetName = ServiceNameParameterSet, HelpMessage = "HealthcareApis FhirService AllowCorsCredentials.")]
[Parameter(Mandatory = false, ParameterSetName = ServiceNameParameterSet, HelpMessage = "HealthcareApis FhirService AllowCorsCredentials.")]
[Parameter(Mandatory = false, ParameterSetName = ResourceIdParameterSet, HelpMessage = "HealthcareApis FhirService AllowCorsCredentials.")]
[ValidateNotNullOrEmpty]
public SwitchParameter AllowCorsCredential { get; set; }
Expand Down Expand Up @@ -191,7 +191,7 @@ public override void ExecuteCmdlet()
}
case InputObjectParameterSet:
{
IList<PSHealthcareApisFhirServiceAccessPolicyEntry> entries = InputObject.Properties.AccessPolicies;
IList<PSHealthcareApisFhirServiceAccessPolicyEntry> entries = InputObject.AccessPolicies;
List<ServiceAccessPolicyEntry> accessPolicies = new List<ServiceAccessPolicyEntry>();

foreach (PSHealthcareApisFhirServiceAccessPolicyEntry entry in entries)
Expand Down Expand Up @@ -284,7 +284,7 @@ private ServicesDescription GenerateServiceDescription(ServicesDescription healt

private IDictionary<string, string> GetTags(ServicesDescription healthcareApisAccount)
{
if(this.Tag!=null && this.Tag.Count > 0)
if (this.Tag != null && this.Tag.Count > 0)
{
Dictionary<string, string> tags = new Dictionary<string, string>();
foreach (DictionaryEntry tag in this.Tag)
Expand Down Expand Up @@ -341,21 +341,21 @@ private ServicesDescription InputObjectToServiceDescription(ServicesDescription
{
AuthenticationConfiguration = new ServiceAuthenticationConfigurationInfo()
{
Authority = InputObject.Properties.AuthenticationConfiguration.Authority?? healthcareApisAccount.Properties.AuthenticationConfiguration.Authority,
Audience = InputObject.Properties.AuthenticationConfiguration.Audience ?? healthcareApisAccount.Properties.AuthenticationConfiguration.Audience,
SmartProxyEnabled = InputObject.Properties.AuthenticationConfiguration.SmartProxyEnabled !=healthcareApisAccount.Properties.AuthenticationConfiguration.SmartProxyEnabled ? InputObject.Properties.AuthenticationConfiguration.SmartProxyEnabled : healthcareApisAccount.Properties.AuthenticationConfiguration.SmartProxyEnabled
Authority = InputObject.Authority ?? healthcareApisAccount.Properties.AuthenticationConfiguration.Authority,
Audience = InputObject.Audience ?? healthcareApisAccount.Properties.AuthenticationConfiguration.Audience,
SmartProxyEnabled = InputObject.SmartProxyEnabled != healthcareApisAccount.Properties.AuthenticationConfiguration.SmartProxyEnabled ? InputObject.SmartProxyEnabled : healthcareApisAccount.Properties.AuthenticationConfiguration.SmartProxyEnabled
},
CosmosDbConfiguration = new ServiceCosmosDbConfigurationInfo()
{
OfferThroughput = InputObject.Properties.CosmosDbConfiguration.OfferThroughput ?? healthcareApisAccount.Properties.CosmosDbConfiguration.OfferThroughput
OfferThroughput = InputObject.CosmosDbOfferThroughput ?? healthcareApisAccount.Properties.CosmosDbConfiguration.OfferThroughput
},
CorsConfiguration = new ServiceCorsConfigurationInfo()
{
Origins = InputObject.Properties.CorsConfiguration.Origins ?? healthcareApisAccount.Properties.CorsConfiguration.Origins,
Headers = InputObject.Properties.CorsConfiguration.Headers ?? healthcareApisAccount.Properties.CorsConfiguration.Headers,
Methods = InputObject.Properties.CorsConfiguration.Methods ?? healthcareApisAccount.Properties.CorsConfiguration.Methods,
MaxAge = InputObject.Properties.CorsConfiguration.MaxAge ?? healthcareApisAccount.Properties.CorsConfiguration.MaxAge,
AllowCredentials = InputObject.Properties.CorsConfiguration.AllowCredentials ?? healthcareApisAccount.Properties.CorsConfiguration.AllowCredentials
Origins = InputObject.CorsOrigins ?? healthcareApisAccount.Properties.CorsConfiguration.Origins,
Headers = InputObject.CorsHeaders ?? healthcareApisAccount.Properties.CorsConfiguration.Headers,
Methods = InputObject.CorsMethods ?? healthcareApisAccount.Properties.CorsConfiguration.Methods,
MaxAge = InputObject.CorsMaxAge ?? healthcareApisAccount.Properties.CorsConfiguration.MaxAge,
AllowCredentials = InputObject.CorsAllowCredentials ?? healthcareApisAccount.Properties.CorsConfiguration.AllowCredentials
},
AccessPolicies = accessPolicies
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Management.HealthcareApis.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;

Expand All @@ -28,28 +29,61 @@ public PSHealthcareApisService(ServicesDescription serviceDescription)
this.Location = serviceDescription.Location;
this.ResourceType = serviceDescription.Type;
this.Tags = serviceDescription.Tags;
this.Properties = new PSHealthcareApisServiceConfig(serviceDescription.Properties);
this.CosmosDbOfferThroughput = serviceDescription.Properties.CosmosDbConfiguration?.OfferThroughput;
this.CorsOrigins = serviceDescription.Properties.CorsConfiguration?.Origins;
this.CorsHeaders = serviceDescription.Properties.CorsConfiguration?.Headers;
this.CorsMethods = serviceDescription.Properties.CorsConfiguration?.Methods;
this.CorsMaxAge = serviceDescription.Properties.CorsConfiguration?.MaxAge;
this.CorsAllowCredentials = serviceDescription.Properties.CorsConfiguration?.AllowCredentials;
this.Authority = serviceDescription.Properties.AuthenticationConfiguration?.Authority;
this.Audience = serviceDescription.Properties.AuthenticationConfiguration?.Audience;
this.SmartProxyEnabled = serviceDescription.Properties.AuthenticationConfiguration?.SmartProxyEnabled;
this.Etag = serviceDescription.Etag;
this.Kind = GetKindValue(serviceDescription.Kind);

var psAccessPolicies = new List<PSHealthcareApisFhirServiceAccessPolicyEntry>();
foreach (ServiceAccessPolicyEntry accessPolicy in serviceDescription.Properties.AccessPolicies)
{
psAccessPolicies.Add(new PSHealthcareApisFhirServiceAccessPolicyEntry(accessPolicy));
}

this.AccessPolicies = psAccessPolicies;
}

public string ResourceGroupName { get; private set; }
public IList<PSHealthcareApisFhirServiceAccessPolicyEntry> AccessPolicies { get; private set; }

public string Name { get; private set; }
public string Audience { get; private set; }

public string Authority { get; private set; }

public bool? CorsAllowCredentials { get; private set; }
public IList<string> CorsHeaders { get; private set; }

public int? CorsMaxAge { get; private set; }

public IList<string> CorsMethods { get; private set; }

public IList<string> CorsOrigins { get; private set; }

public int? CosmosDbOfferThroughput { get; private set; }

public string Etag { get; private set; }

public string Id { get; private set; }

public string Kind { get; private set; }

public string Location { get; private set; }

public string ResourceType { get; private set; }
public string Name { get; private set; }

public string Kind { get; private set; }
public string ResourceGroupName { get; private set; }

public IDictionary<string, string> Tags { get; private set; }

public PSHealthcareApisServiceConfig Properties { get; private set; }
public string ResourceType { get; private set; }

public string Etag { get; private set; }
public bool? SmartProxyEnabled { get; private set; }

public static PSHealthcareApisService Create(ServicesDescription healthcareApisAccount)
{
Expand All @@ -73,7 +107,7 @@ private static string GetKindValue(Kind kind)
switch (kind)
{
case Management.HealthcareApis.Models.Kind.Fhir:
return "fhir-Stu3";
return "fhir-R4";
case Management.HealthcareApis.Models.Kind.FhirStu3:
return "fhir-Stu3";
case Management.HealthcareApis.Models.Kind.FhirR4:
Expand Down
4 changes: 2 additions & 2 deletions src/HealthcareApis/HealthcareApis/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("0.7.1")]
[assembly: AssemblyVersion("0.1.2")]
[assembly: AssemblyFileVersion("0.1.2")]
[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.0.0")]
Loading

0 comments on commit 5072ee3

Please sign in to comment.