Exemple #1
0
 /// <summary>
 /// Gets a list of resource providers.
 /// </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 <Provider> > ListNextAsync(this IProvidersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemple #2
0
 /// <summary>
 /// Registers provider to be used with a subscription.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceProviderNamespace'>
 /// Namespace of the resource provider.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Provider> RegisterAsync(this IProvidersOperations operations, string resourceProviderNamespace, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.RegisterWithHttpMessagesAsync(resourceProviderNamespace, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets the specified resource provider at the tenant level.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceProviderNamespace'>
 /// The namespace of the resource provider.
 /// </param>
 /// <param name='expand'>
 /// The $expand query parameter. For example, to include property aliases in
 /// response, use $expand=resourceTypes/aliases.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ProviderInner> GetAtTenantScopeAsync(this IProvidersOperations operations, string resourceProviderNamespace, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetAtTenantScopeWithHttpMessagesAsync(resourceProviderNamespace, expand, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemple #4
0
 /// <summary>
 /// Gets a list of resource providers.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='top'>
 /// Query parameters. If null is passed returns all deployments.
 /// </param>
 /// <param name='expand'>
 /// The $expand query parameter. e.g. To include property aliases in response,
 /// use $expand=resourceTypes/aliases.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <Provider> > ListAsync(this IProvidersOperations operations, int?top = default(int?), string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(top, expand, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get provider status.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <ProviderStatus> > GetStatusAsync(this IProvidersOperations operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetStatusWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemple #6
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Jobs           = new JobsOperations(this);
     Providers      = new ProvidersOperations(this);
     BaseUri        = new System.Uri("https://app-jobscheduler-prod.azurewebsites.net");
     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>
 /// Gets the specified resource provider.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceProviderNamespace'>
 /// The namespace of the resource provider.
 /// </param>
 /// <param name='expand'>
 /// The $expand query parameter. For example, to include property aliases in
 /// response, use $expand=resourceTypes/aliases.
 /// </param>
 public static Provider Get(this IProvidersOperations operations, string resourceProviderNamespace, string expand = default(string))
 {
     return(operations.GetAsync(resourceProviderNamespace, expand).GetAwaiter().GetResult());
 }
Exemple #8
0
 /// <summary>
 /// Gets a list of resource providers.
 /// </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 <Provider> ListNext(this IProvidersOperations operations, string nextPageLink)
 {
     return(Task.Factory.StartNew(s => ((IProvidersOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemple #9
0
 /// <summary>
 /// Gets a list of resource providers.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='top'>
 /// Query parameters. If null is passed returns all deployments.
 /// </param>
 /// <param name='expand'>
 /// The $expand query parameter. e.g. To include property aliases in response,
 /// use $expand=resourceTypes/aliases.
 /// </param>
 public static IPage <Provider> List(this IProvidersOperations operations, int?top = default(int?), string expand = default(string))
 {
     return(Task.Factory.StartNew(s => ((IProvidersOperations)s).ListAsync(top, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Registers a subscription with a resource provider.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceProviderNamespace'>
 /// The namespace of the resource provider to register.
 /// </param>
 public static Provider Register(this IProvidersOperations operations, string resourceProviderNamespace)
 {
     return(operations.RegisterAsync(resourceProviderNamespace).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Gets all resource providers for a subscription.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='top'>
 /// The number of results to return. If null is passed returns all deployments.
 /// </param>
 /// <param name='expand'>
 /// The properties to include in the results. For example, use
 /// &amp;$expand=metadata in the query string to retrieve resource provider
 /// metadata. To include property aliases in response, use
 /// $expand=resourceTypes/aliases.
 /// </param>
 public static IPage <Provider> List(this IProvidersOperations operations, int?top = default(int?), string expand = default(string))
 {
     return(operations.ListAsync(top, expand).GetAwaiter().GetResult());
 }
Exemple #12
0
 /// <summary>
 /// Registers provider to be used with a subscription.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceProviderNamespace'>
 /// Namespace of the resource provider.
 /// </param>
 public static Provider Register(this IProvidersOperations operations, string resourceProviderNamespace)
 {
     return(Task.Factory.StartNew(s => ((IProvidersOperations)s).RegisterAsync(resourceProviderNamespace), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemple #13
0
 /// <summary>
 /// Registers a management group with a resource provider.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceProviderNamespace'>
 /// The namespace of the resource provider to register.
 /// </param>
 /// <param name='groupId'>
 /// The management group ID.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task RegisterAtManagementGroupScopeAsync(this IProvidersOperations operations, string resourceProviderNamespace, string groupId, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.RegisterAtManagementGroupScopeWithHttpMessagesAsync(resourceProviderNamespace, groupId, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Exemple #14
0
 /// <summary>
 /// Registers a management group with a resource provider.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceProviderNamespace'>
 /// The namespace of the resource provider to register.
 /// </param>
 /// <param name='groupId'>
 /// The management group ID.
 /// </param>
 public static void RegisterAtManagementGroupScope(this IProvidersOperations operations, string resourceProviderNamespace, string groupId)
 {
     operations.RegisterAtManagementGroupScopeAsync(resourceProviderNamespace, groupId).GetAwaiter().GetResult();
 }
Exemple #15
0
 /// <summary>
 /// Registers a subscription with a resource provider.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceProviderNamespace'>
 /// The namespace of the resource provider to register.
 /// </param>
 /// <param name='properties'>
 /// The third party consent for S2S.
 /// </param>
 public static Provider Register(this IProvidersOperations operations, string resourceProviderNamespace, ProviderRegistrationRequest properties = default(ProviderRegistrationRequest))
 {
     return(operations.RegisterAsync(resourceProviderNamespace, properties).GetAwaiter().GetResult());
 }
Exemple #16
0
 /// <summary>
 /// Get the provider permissions.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceProviderNamespace'>
 /// The namespace of the resource provider.
 /// </param>
 public static ProviderPermissionListResult ProviderPermissions(this IProvidersOperations operations, string resourceProviderNamespace)
 {
     return(operations.ProviderPermissionsAsync(resourceProviderNamespace).GetAwaiter().GetResult());
 }
 internal ProvidersImpl(IProvidersOperations client)
 {
     this.client = client;
 }
 /// <summary>
 /// Gets all resource providers for a 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 <Provider> ListNext(this IProvidersOperations operations, string nextPageLink)
 {
     return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get provider status.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IPage <ProviderStatus> GetStatus(this IProvidersOperations operations)
 {
     return(operations.GetStatusAsync().GetAwaiter().GetResult());
 }