コード例 #1
0
 /// <summary>
 /// Unlink a plan from an offer.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group the resource is located under.
 /// </param>
 /// <param name='offer'>
 /// Name of an offer.
 /// </param>
 /// <param name='planLink'>
 /// New plan link.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Offer> UnlinkAsync(this IOffersOperations operations, string resourceGroupName, string offer, PlanLinkDefinition planLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UnlinkWithHttpMessagesAsync(resourceGroupName, offer, planLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #2
0
 /// <summary>
 /// Get the list of offers under a resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group the resource is located under.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <Offer> > ListAsync(this IOffersOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #3
0
 /// <summary>
 /// Create or update the offer.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group the resource is located under.
 /// </param>
 /// <param name='offer'>
 /// Name of an offer.
 /// </param>
 /// <param name='newOffer'>
 /// New offer.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Offer> CreateOrUpdateAsync(this IOffersOperations operations, string resourceGroupName, string offer, Offer newOffer, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, offer, newOffer, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #4
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Subscriptions           = new SubscriptionsOperations(this);
     Operations              = new Operations(this);
     DelegatedProviderOffers = new DelegatedProviderOffersOperations(this);
     Offers         = new OffersOperations(this);
     BaseUri        = new System.Uri("https://management.local.azurestack.external");
     ApiVersion     = "2015-11-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()
         }
     };
     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 CloudErrorJsonConverter());
 }
コード例 #5
0
 /// <summary>
 /// Get the specified offer.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group the resource is located under.
 /// </param>
 /// <param name='offer'>
 /// Name of an offer.
 /// </param>
 public static Offer Get(this IOffersOperations operations, string resourceGroupName, string offer)
 {
     return(operations.GetAsync(resourceGroupName, offer).GetAwaiter().GetResult());
 }
コード例 #6
0
 /// <summary>
 /// Get the list of offers under a resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group the resource is located under.
 /// </param>
 public static IPage <Offer> List(this IOffersOperations operations, string resourceGroupName)
 {
     return(operations.ListAsync(resourceGroupName).GetAwaiter().GetResult());
 }
コード例 #7
0
 /// <summary>
 /// Get the list of offers under a 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 <Offer> ListNext(this IOffersOperations operations, string nextPageLink)
 {
     return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
コード例 #8
0
 /// <summary>
 /// Unlink a plan from an offer.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group the resource is located under.
 /// </param>
 /// <param name='offer'>
 /// Name of an offer.
 /// </param>
 /// <param name='planLink'>
 /// New plan link.
 /// </param>
 public static Offer Unlink(this IOffersOperations operations, string resourceGroupName, string offer, PlanLinkDefinition planLink)
 {
     return(operations.UnlinkAsync(resourceGroupName, offer, planLink).GetAwaiter().GetResult());
 }
コード例 #9
0
 /// <summary>
 /// Get the list of offers.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IPage <Offer> ListAll(this IOffersOperations operations)
 {
     return(operations.ListAllAsync().GetAwaiter().GetResult());
 }
コード例 #10
0
 /// <summary>
 /// Get the metric definitions.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group the resource is located under.
 /// </param>
 /// <param name='offer'>
 /// Name of an offer.
 /// </param>
 public static MetricDefinitionList ListMetricDefinitions(this IOffersOperations operations, string resourceGroupName, string offer)
 {
     return(operations.ListMetricDefinitionsAsync(resourceGroupName, offer).GetAwaiter().GetResult());
 }
コード例 #11
0
 /// <summary>
 /// Delete the specified offer.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group the resource is located under.
 /// </param>
 /// <param name='offer'>
 /// Name of an offer.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IOffersOperations operations, string resourceGroupName, string offer, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, offer, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
コード例 #12
0
 /// <summary>
 /// Delete the specified offer.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group the resource is located under.
 /// </param>
 /// <param name='offer'>
 /// Name of an offer.
 /// </param>
 public static void Delete(this IOffersOperations operations, string resourceGroupName, string offer)
 {
     operations.DeleteAsync(resourceGroupName, offer).GetAwaiter().GetResult();
 }
コード例 #13
0
 /// <summary>
 /// Create or update the offer.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group the resource is located under.
 /// </param>
 /// <param name='offer'>
 /// Name of an offer.
 /// </param>
 /// <param name='newOffer'>
 /// New offer.
 /// </param>
 public static Offer CreateOrUpdate(this IOffersOperations operations, string resourceGroupName, string offer, Offer newOffer)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, offer, newOffer).GetAwaiter().GetResult());
 }