예제 #1
0
 /// <summary>
 /// Creating or Updating a Spatial Anchors Account.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of an Azure resource group.
 /// </param>
 /// <param name='accountName'>
 /// Name of an Mixed Reality Account.
 /// </param>
 /// <param name='spatialAnchorsAccount'>
 /// Spatial Anchors Account parameter.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <SpatialAnchorsAccount> CreateAsync(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName, SpatialAnchorsAccount spatialAnchorsAccount, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, spatialAnchorsAccount, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #2
0
 /// <summary>
 /// Regenerate specified Key of a Spatial Anchors Account
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of an Azure resource group.
 /// </param>
 /// <param name='accountName'>
 /// Name of an Mixed Reality Account.
 /// </param>
 /// <param name='serial'>
 /// Serial of key to be regenerated
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <AccountKeys> RegenerateKeysAsync(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName, int?serial = 1, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.RegenerateKeysWithHttpMessagesAsync(resourceGroupName, accountName, serial, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #3
0
 private static void AssertSpatialAnchorsAccountNotExist(ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string spatialAnchorsAccountName)
 {
     try
     {
         operations.Get(resourceGroupName, spatialAnchorsAccountName);
     }
     catch (ErrorResponseException e)
     {
         Assert.Equal(HttpStatusCode.NotFound, e.Response.StatusCode);
     }
 }
예제 #4
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Operations             = new Operations(this);
     SpatialAnchorsAccounts = new SpatialAnchorsAccountsOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2019-02-28-preview";
     AcceptLanguage = "en-US";
     LongRunningOperationRetryTimeout = 30;
     GenerateClientRequestId          = true;
     SerializationSettings            = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
예제 #5
0
 internal static IEnumerable <SpatialAnchorsAccount> EnumerateBySubscription(this ISpatialAnchorsAccountsOperations operations)
 {
     return(Enumerate(() => operations.ListBySubscription(), link => operations.ListBySubscriptionNext(link)).ToList());
 }
예제 #6
0
 internal static SpatialAnchorsAccount Find(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string spatialAnchorsAccountName)
 {
     return(operations.EnumerateByResourceGroup(resourceGroupName).FirstOrDefault(account => string.Equals(account.Name, spatialAnchorsAccountName, StringComparison.InvariantCultureIgnoreCase)));
 }
예제 #7
0
 /// <summary>
 /// Delete a Spatial Anchors Account.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of an Azure resource group.
 /// </param>
 /// <param name='accountName'>
 /// Name of an Mixed Reality Account.
 /// </param>
 public static void Delete(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName)
 {
     operations.DeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult();
 }
예제 #8
0
 /// <summary>
 /// List Resources by Resource Group
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of an Azure resource group.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <SpatialAnchorsAccount> > ListByResourceGroupAsync(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #9
0
 /// <summary>
 /// List Resources by Resource Group
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of an Azure resource group.
 /// </param>
 public static IPage <SpatialAnchorsAccount> ListByResourceGroup(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName)
 {
     return(operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult());
 }
예제 #10
0
 /// <summary>
 /// List Spatial Anchors Accounts by Subscription
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <SpatialAnchorsAccount> > ListBySubscriptionAsync(this ISpatialAnchorsAccountsOperations operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #11
0
 /// <summary>
 /// Regenerate specified Key of a Spatial Anchors Account
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of an Azure resource group.
 /// </param>
 /// <param name='accountName'>
 /// Name of an Mixed Reality Account.
 /// </param>
 /// <param name='serial'>
 /// Serial of key to be regenerated
 /// </param>
 public static AccountKeys RegenerateKeys(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName, int?serial = 1)
 {
     return(operations.RegenerateKeysAsync(resourceGroupName, accountName, serial).GetAwaiter().GetResult());
 }
예제 #12
0
 /// <summary>
 /// List Spatial Anchors Accounts by Subscription
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IPage <SpatialAnchorsAccount> ListBySubscription(this ISpatialAnchorsAccountsOperations operations)
 {
     return(operations.ListBySubscriptionAsync().GetAwaiter().GetResult());
 }
예제 #13
0
 /// <summary>
 /// List Both of the 2 Keys of a Spatial Anchors Account
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of an Azure resource group.
 /// </param>
 /// <param name='accountName'>
 /// Name of an Mixed Reality Account.
 /// </param>
 public static AccountKeys ListKeys(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName)
 {
     return(operations.ListKeysAsync(resourceGroupName, accountName).GetAwaiter().GetResult());
 }
예제 #14
0
 /// <summary>
 /// Creating or Updating a Spatial Anchors Account.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of an Azure resource group.
 /// </param>
 /// <param name='accountName'>
 /// Name of an Mixed Reality Account.
 /// </param>
 /// <param name='spatialAnchorsAccount'>
 /// Spatial Anchors Account parameter.
 /// </param>
 public static SpatialAnchorsAccount Create(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName, SpatialAnchorsAccount spatialAnchorsAccount)
 {
     return(operations.CreateAsync(resourceGroupName, accountName, spatialAnchorsAccount).GetAwaiter().GetResult());
 }
예제 #15
0
 /// <summary>
 /// Delete a Spatial Anchors Account.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of an Azure resource group.
 /// </param>
 /// <param name='accountName'>
 /// Name of an Mixed Reality Account.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
예제 #16
0
 internal static IEnumerable <SpatialAnchorsAccount> EnumerateByResourceGroup(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName)
 {
     return(Enumerate(() => operations.ListByResourceGroup(resourceGroupName), link => operations.ListByResourceGroupNext(link)).ToList());
 }
예제 #17
0
 /// <summary>
 /// List Resources by Resource Group
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <SpatialAnchorsAccount> ListByResourceGroupNext(this ISpatialAnchorsAccountsOperations operations, string nextPageLink)
 {
     return(operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Retrieve a Spatial Anchors Account.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of an Azure resource group.
 /// </param>
 /// <param name='spatialAnchorsAccountName'>
 /// Name of an Mixed Reality Spatial Anchors Account.
 /// </param>
 public static SpatialAnchorsAccount Get(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string spatialAnchorsAccountName)
 {
     return(operations.GetAsync(resourceGroupName, spatialAnchorsAccountName).GetAwaiter().GetResult());
 }