Example #1
0
 /// <summary>
 /// Initializes a new instance of the AzureStackClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public AzureStackClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._clouds          = new CloudOperations(this);
     this._curation        = new CurationOperations(this);
     this._delegatedOffers = new DelegatedOfferOperations(this);
     this._delegatedProviderConfiguration = new DelegatedProviderConfigurationOperations(this);
     this._eventTypes            = new EventTypesOperations(this);
     this._extensionsMetadata    = new ExtensionMetadataOperations(this);
     this._galleryItem           = new GalleryItemOperations(this);
     this._importedSubscriptions = new ImportedSubscriptionOperations(this);
     this._managedLocations      = new ManagedLocationOperations(this);
     this._managedOffers         = new ManagedOfferOperations(this);
     this._managedPlans          = new ManagedPlanOperations(this);
     this._managedSubscriptions  = new ManagedSubscriptionOperations(this);
     this._offers  = new OfferOperations(this);
     this._package = new PackageOperations(this);
     this._plans   = new PlanOperations(this);
     this._providerRegistrations = new ProviderRegistrationOperations(this);
     this._publicGalleryItem     = new PublicGalleryItemOperations(this);
     this._resourceGroups        = new ResourceGroupOperations(this);
     this._resources             = new ResourceOperations(this);
     this._resourceProviders     = new ResourceProviderOperations(this);
     this._shallowResources      = new ShallowResourceOperations(this);
     this._subscriptions         = new SubscriptionOperations(this);
     this.HttpClient.Timeout     = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Delete operation of the subscription
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
 /// </param>
 /// <param name='subscriptionId'>
 /// Required. Subscription Id
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse Delete(this IManagedSubscriptionOperations operations, string subscriptionId)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IManagedSubscriptionOperations)s).DeleteAsync(subscriptionId);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Create or updates the subscription
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Subscription update parameters
 /// </param>
 /// <returns>
 /// Result of the create or the update operation of the subscription
 /// </returns>
 public static ManagedSubscriptionCreateOrUpdateResult CreateOrUpdate(this IManagedSubscriptionOperations operations, ManagedSubscriptionCreateOrUpdateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IManagedSubscriptionOperations)s).CreateOrUpdateAsync(parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Lists the subscription with the next link
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. The URL pointing to get the next set of subscriptions
 /// </param>
 /// <returns>
 /// Result of the list operations
 /// </returns>
 public static ManagedSubscriptionListResult ListNext(this IManagedSubscriptionOperations operations, string nextLink)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IManagedSubscriptionOperations)s).ListNextAsync(nextLink);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the AzureStackClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public AzureStackClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._curation             = new CurationOperations(this);
     this._extensionsMetadata   = new ExtensionMetadataOperations(this);
     this._galleryItem          = new GalleryItemOperations(this);
     this._managedLocations     = new ManagedLocationOperations(this);
     this._managedOffers        = new ManagedOfferOperations(this);
     this._managedPlans         = new ManagedPlanOperations(this);
     this._managedSubscriptions = new ManagedSubscriptionOperations(this);
     this._offers = new OfferOperations(this);
     this._plans  = new PlanOperations(this);
     this._providerRegistrations = new ProviderRegistrationOperations(this);
     this._publicGalleryItem     = new PublicGalleryItemOperations(this);
     this._resourceGroups        = new ResourceGroupOperations(this);
     this._subscriptions         = new SubscriptionOperations(this);
     this._usageConnections      = new UsageConnectionsOperations(this);
     this.HttpClient.Timeout     = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Create or updates the subscription
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Subscription update parameters
 /// </param>
 /// <returns>
 /// Result of the create or the update operation of the subscription
 /// </returns>
 public static Task <ManagedSubscriptionCreateOrUpdateResult> CreateOrUpdateAsync(this IManagedSubscriptionOperations operations, ManagedSubscriptionCreateOrUpdateParameters parameters)
 {
     return(operations.CreateOrUpdateAsync(parameters, CancellationToken.None));
 }
 /// <summary>
 /// Lists the subscription with the next link
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. The URL pointing to get the next set of subscriptions
 /// </param>
 /// <returns>
 /// Result of the list operations
 /// </returns>
 public static Task <ManagedSubscriptionListResult> ListNextAsync(this IManagedSubscriptionOperations operations, string nextLink)
 {
     return(operations.ListNextAsync(nextLink, CancellationToken.None));
 }
 /// <summary>
 /// Lists the subscriptions
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
 /// </param>
 /// <param name='includeDetails'>
 /// Required.
 /// </param>
 /// <returns>
 /// Result of the list operations
 /// </returns>
 public static Task <ManagedSubscriptionListResult> ListAsync(this IManagedSubscriptionOperations operations, bool includeDetails)
 {
     return(operations.ListAsync(includeDetails, CancellationToken.None));
 }
 /// <summary>
 /// Gets the administrator view of the subscription
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
 /// </param>
 /// <param name='subscriptionId'>
 /// Required. Subscription Id
 /// </param>
 /// <returns>
 /// Result of the subscription get operation
 /// </returns>
 public static Task <ManagedSubscriptionGetResult> GetAsync(this IManagedSubscriptionOperations operations, string subscriptionId)
 {
     return(operations.GetAsync(subscriptionId, CancellationToken.None));
 }
 /// <summary>
 /// Delete operation of the subscription
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
 /// </param>
 /// <param name='subscriptionId'>
 /// Required. Subscription Id
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> DeleteAsync(this IManagedSubscriptionOperations operations, string subscriptionId)
 {
     return(operations.DeleteAsync(subscriptionId, CancellationToken.None));
 }