/// <summary> /// Lists gallery items. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IEnumerable <GalleryItem> > ListAsync(this IGalleryItemsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Uploads a provider gallery item to the storage. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='galleryItemUri'> /// URI for your gallery package that has already been uploaded online. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <GalleryItem> CreateAsync(this IGalleryItemsOperations operations, string galleryItemUri = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateWithHttpMessagesAsync(galleryItemUri, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Operations = new Operations(this); GalleryItems = new GalleryItemsOperations(this); BaseUri = new System.Uri("https://adminmanagement.local.azurestack.external"); ApiVersion = "2015-04-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() } }; 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> /// Get a specific gallery item. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='galleryItemName'> /// Identity of the gallery item. Includes publisher name, item name, and may /// include version separated by period character. /// </param> public static GalleryItem Get(this IGalleryItemsOperations operations, string galleryItemName) { return(operations.GetAsync(galleryItemName).GetAwaiter().GetResult()); }
/// <summary> /// Uploads a provider gallery item to the storage. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='galleryItemUri'> /// URI for your gallery package that has already been uploaded online. /// </param> public static GalleryItem Create(this IGalleryItemsOperations operations, string galleryItemUri = default(string)) { return(operations.CreateAsync(galleryItemUri).GetAwaiter().GetResult()); }
/// <summary> /// Lists gallery items. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static IEnumerable <GalleryItem> List(this IGalleryItemsOperations operations) { return(operations.ListAsync().GetAwaiter().GetResult()); }
/// <summary> /// Delete a specific gallery item. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='galleryItemName'> /// Identity of the gallery item. Includes publisher name, item name, and may /// include version separated by period character. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this IGalleryItemsOperations operations, string galleryItemName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(galleryItemName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Delete a specific gallery item. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='galleryItemName'> /// Identity of the gallery item. Includes publisher name, item name, and may /// include version separated by period character. /// </param> public static void Delete(this IGalleryItemsOperations operations, string galleryItemName) { operations.DeleteAsync(galleryItemName).GetAwaiter().GetResult(); }