forked from Azure/azure-powershell
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ebfa508
commit 3237c8e
Showing
5 changed files
with
58 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
experiments/Azure.Experiments/Azure.Experiments/PublicIpAddressObject.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Microsoft.Azure.Management.Network; | ||
using Microsoft.Azure.Management.Network.Models; | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Azure.Experiments | ||
{ | ||
public sealed class PublicIpAddressObject : | ||
ResourceObject<PublicIPAddress, IPublicIPAddressesOperations> | ||
{ | ||
public PublicIpAddressObject(string name, ResourceGroupObject rg) : base(name, rg) | ||
{ | ||
} | ||
|
||
protected override Task<PublicIPAddress> CreateAsync(IPublicIPAddressesOperations c) | ||
=> c.CreateOrUpdateAsync( | ||
ResourceGroupName, | ||
Name, | ||
new PublicIPAddress { Location = "eastus" }); | ||
|
||
protected override IPublicIPAddressesOperations CreateClient(Context c) | ||
=> c.CreateNetwork().PublicIPAddresses; | ||
|
||
protected override Task DeleteAsync(IPublicIPAddressesOperations c) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
protected override Task<PublicIPAddress> GetOrThrowAsync(IPublicIPAddressesOperations c) | ||
=> c.GetAsync(ResourceGroupName, Name); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters