示例#1
0
        public static MapsAccountCreateParameters GetDefaultMapsAccountParameters()
        {
            var account = new MapsAccountCreateParameters
            {
                Location = DefaultLocation,
                Tags     = DefaultTags,
                Sku      = new Microsoft.Azure.Management.Maps.Models.Sku()
                {
                    Name = DefaultSkuName
                }
            };

            return(account);
        }
示例#2
0
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();

            RunCmdLet(() =>
            {
                MapsAccountCreateParameters createParameters = new MapsAccountCreateParameters()
                {
                    Sku      = new Sku(this.SkuName),
                    Tags     = TagsConversionHelper.CreateTagDictionary(Tag),
                    Location = "global"
                };

                if (ShouldProcess(
                        this.Name, string.Format(CultureInfo.CurrentCulture, Resources.NewAccount_ProcessMessage, this.Name, this.SkuName)))
                {
                    if (Force.IsPresent)
                    {
                        WriteWarning(Resources.NewAccount_Notice);
                    }
                    else
                    {
                        bool yesToAll = false, noToAll = false;
                        if (!ShouldContinue(Resources.NewAccount_Notice, "Notice", true, ref yesToAll, ref noToAll))
                        {
                            return;
                        }
                    }

                    var createAccountResponse = this.MapsClient.Accounts.CreateOrUpdate(
                        this.ResourceGroupName,
                        this.Name,
                        createParameters);

                    var mapsAccount = this.MapsClient.Accounts.Get(this.ResourceGroupName, this.Name);

                    this.WriteMapsAccount(mapsAccount);
                }
            });
        }
 /// <summary>
 /// Create or update a Maps Account. A Maps Account holds the keys which allow
 /// access to the Maps REST APIs.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the Azure Resource Group.
 /// </param>
 /// <param name='accountName'>
 /// The name of the Maps Account.
 /// </param>
 /// <param name='mapsAccountCreateParameters'>
 /// The new or updated parameters for the Maps Account.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <MapsAccount> CreateOrUpdateAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, MapsAccountCreateParameters mapsAccountCreateParameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, mapsAccountCreateParameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Create or update a Maps Account. A Maps Account holds the keys which allow
 /// access to the Maps REST APIs.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the Azure Resource Group.
 /// </param>
 /// <param name='accountName'>
 /// The name of the Maps Account.
 /// </param>
 /// <param name='mapsAccountCreateParameters'>
 /// The new or updated parameters for the Maps Account.
 /// </param>
 public static MapsAccount CreateOrUpdate(this IAccountsOperations operations, string resourceGroupName, string accountName, MapsAccountCreateParameters mapsAccountCreateParameters)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, accountName, mapsAccountCreateParameters).GetAwaiter().GetResult());
 }