/// <summary>
 /// Returns a feature registration
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='providerNamespace'>
 /// The provider namespace.
 /// </param>
 /// <param name='featureName'>
 /// The feature name.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <SubscriptionFeatureRegistration> GetAsync(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(providerNamespace, featureName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Features = new FeaturesOperations(this);
     SubscriptionFeatureRegistrations = new SubscriptionFeatureRegistrationsOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2021-07-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());
 }
 /// <summary>
 /// Create or update a feature registration.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='providerNamespace'>
 /// The provider namespace.
 /// </param>
 /// <param name='featureName'>
 /// The feature name.
 /// </param>
 /// <param name='subscriptionFeatureRegistrationType'>
 /// Subscription Feature Registration Type details.
 /// </param>
 public static SubscriptionFeatureRegistration CreateOrUpdate(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName, SubscriptionFeatureRegistration subscriptionFeatureRegistrationType = default(SubscriptionFeatureRegistration))
 {
     return(operations.CreateOrUpdateAsync(providerNamespace, featureName, subscriptionFeatureRegistrationType).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Returns subscription feature registrations for 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 <SubscriptionFeatureRegistration> > ListAllBySubscriptionNextAsync(this ISubscriptionFeatureRegistrationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListAllBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Returns a feature registration
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='providerNamespace'>
 /// The provider namespace.
 /// </param>
 /// <param name='featureName'>
 /// The feature name.
 /// </param>
 public static SubscriptionFeatureRegistration Get(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName)
 {
     return(operations.GetAsync(providerNamespace, featureName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Returns subscription feature registrations for 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 <SubscriptionFeatureRegistration> ListAllBySubscriptionNext(this ISubscriptionFeatureRegistrationsOperations operations, string nextPageLink)
 {
     return(operations.ListAllBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Returns subscription feature registrations for given subscription.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IPage <SubscriptionFeatureRegistration> ListAllBySubscription(this ISubscriptionFeatureRegistrationsOperations operations)
 {
     return(operations.ListAllBySubscriptionAsync().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Returns subscription feature registrations for given subscription and
 /// provider namespace.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='providerNamespace'>
 /// The provider namespace.
 /// </param>
 public static IPage <SubscriptionFeatureRegistration> ListBySubscription(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace)
 {
     return(operations.ListBySubscriptionAsync(providerNamespace).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Deletes a feature registration
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='providerNamespace'>
 /// The provider namespace.
 /// </param>
 /// <param name='featureName'>
 /// The feature name.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(providerNamespace, featureName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Deletes a feature registration
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='providerNamespace'>
 /// The provider namespace.
 /// </param>
 /// <param name='featureName'>
 /// The feature name.
 /// </param>
 public static void Delete(this ISubscriptionFeatureRegistrationsOperations operations, string providerNamespace, string featureName)
 {
     operations.DeleteAsync(providerNamespace, featureName).GetAwaiter().GetResult();
 }