示例#1
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     ContainerGroups        = new ContainerGroupsOperations(this);
     Operations             = new Operations(this);
     ContainerGroupUsage    = new ContainerGroupUsageOperations(this);
     Container              = new ContainerOperations(this);
     ServiceAssociationLink = new ServiceAssociationLinkOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2018-10-01";
     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());
 }
 /// <summary>
 /// Delete the container instance service association link for the subnet.
 /// </summary>
 /// <remarks>
 /// Delete the container instance service association link for the subnet. This
 /// operation unblocks user from deleting subnet.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='virtualNetworkName'>
 /// The name of the virtual network.
 /// </param>
 /// <param name='subnetName'>
 /// The name of the subnet.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IServiceAssociationLinkOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Delete the container instance service association link for the subnet.
 /// </summary>
 /// <remarks>
 /// Delete the container instance service association link for the subnet. This
 /// operation unblocks user from deleting subnet.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='virtualNetworkName'>
 /// The name of the virtual network.
 /// </param>
 /// <param name='subnetName'>
 /// The name of the subnet.
 /// </param>
 public static void Delete(this IServiceAssociationLinkOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName)
 {
     operations.DeleteAsync(resourceGroupName, virtualNetworkName, subnetName).GetAwaiter().GetResult();
 }