Example #1
0
 /// <summary>
 /// Gets an existing peering with the specified name under the given
 /// subscription and resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='peeringName'>
 /// The name of the peering.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <PeeringModel> GetAsync(this IPeeringsOperations operations, string resourceGroupName, string peeringName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, peeringName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #2
0
 /// <summary>
 /// Updates tags for a peering with the specified name under the given
 /// subscription and resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='peeringName'>
 /// The name of the peering.
 /// </param>
 /// <param name='tags'>
 /// Gets or sets the tags, a dictionary of descriptors arm object
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <PeeringModel> UpdateAsync(this IPeeringsOperations operations, string resourceGroupName, string peeringName, IDictionary <string, string> tags = default(IDictionary <string, string>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, peeringName, tags, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Lists all of the peerings under the given subscription.
 /// </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>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <PeeringModel> > ListBySubscriptionNextAsync(this IPeeringsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     LegacyPeerings   = new LegacyPeeringsOperations(this);
     Operations       = new Operations(this);
     PeerAsns         = new PeerAsnsOperations(this);
     PeeringLocations = new PeeringLocationsOperations(this);
     Peerings         = new PeeringsOperations(this);
     BaseUri          = new System.Uri("https://management.azure.com");
     ApiVersion       = "2019-03-01-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());
 }
Example #5
0
 /// <summary>
 /// Creates a new peering or updates an existing peering with the specified
 /// name under the given subscription and resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='peeringName'>
 /// The name of the peering.
 /// </param>
 /// <param name='peering'>
 /// The properties needed to create or update a peering.
 /// </param>
 public static PeeringModel CreateOrUpdate(this IPeeringsOperations operations, string resourceGroupName, string peeringName, PeeringModel peering)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, peeringName, peering).GetAwaiter().GetResult());
 }
Example #6
0
 /// <summary>
 /// Gets an existing peering with the specified name under the given
 /// subscription and resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='peeringName'>
 /// The name of the peering.
 /// </param>
 public static PeeringModel Get(this IPeeringsOperations operations, string resourceGroupName, string peeringName)
 {
     return(operations.GetAsync(resourceGroupName, peeringName).GetAwaiter().GetResult());
 }
Example #7
0
 /// <summary>
 /// Lists all of the peerings under the given subscription.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IEnumerable <PeeringModel> ListBySubscription(this IPeeringsOperations operations)
 {
     return(operations.ListBySubscriptionAsync().GetAwaiter().GetResult());
 }
Example #8
0
 /// <summary>
 /// Lists all of the peerings under the given subscription and resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 public static IEnumerable <PeeringModel> ListByResourceGroup(this IPeeringsOperations operations, string resourceGroupName)
 {
     return(operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult());
 }
Example #9
0
 /// <summary>
 /// Updates tags for a peering with the specified name under the given
 /// subscription and resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='peeringName'>
 /// The name of the peering.
 /// </param>
 /// <param name='tags'>
 /// Gets or sets the tags, a dictionary of descriptors arm object
 /// </param>
 public static PeeringModel Update(this IPeeringsOperations operations, string resourceGroupName, string peeringName, IDictionary <string, string> tags = default(IDictionary <string, string>))
 {
     return(operations.UpdateAsync(resourceGroupName, peeringName, tags).GetAwaiter().GetResult());
 }
Example #10
0
 /// <summary>
 /// Deletes an existing peering with the specified name under the given
 /// subscription and resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='peeringName'>
 /// The name of the peering.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IPeeringsOperations operations, string resourceGroupName, string peeringName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Example #11
0
 /// <summary>
 /// Deletes an existing peering with the specified name under the given
 /// subscription and resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='peeringName'>
 /// The name of the peering.
 /// </param>
 public static void Delete(this IPeeringsOperations operations, string resourceGroupName, string peeringName)
 {
     operations.DeleteAsync(resourceGroupName, peeringName).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Lists all of the peerings under the given subscription.
 /// </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 <PeeringModel> ListBySubscriptionNext(this IPeeringsOperations operations, string nextPageLink)
 {
     return(operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Updates tags for a peering with the specified name under the given
 /// subscription and resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='peeringName'>
 /// The name of the peering.
 /// </param>
 /// <param name='tags'>
 /// The resource tags.
 /// </param>
 public static PeeringModel Update(this IPeeringsOperations operations, string resourceGroupName, string peeringName, ResourceTags tags)
 {
     return(operations.UpdateAsync(resourceGroupName, peeringName, tags).GetAwaiter().GetResult());
 }