Пример #1
0
 /// <summary>
 ///  Initializes a new instance of the <see cref="OneDriveThumbnailSet"/> class.
 /// </summary>
 /// <param name="set">Original set from OneDrive SDK</param>
 internal OneDriveThumbnailSet(Microsoft.OneDrive.Sdk.ThumbnailSet set)
 {
     Small  = set.Small.Url;
     Medium = set.Medium.Url;
     Large  = set.Large.Url;
     Source = set.Source?.Url;
 }
 /// <summary>
 /// Creates the specified ThumbnailSet using PUT.
 /// </summary>
 /// <param name="thumbnailSet">The ThumbnailSet to create.</param>
 /// <returns>The created ThumbnailSet.</returns>
 public async Task<ThumbnailSet> CreateAsync(ThumbnailSet thumbnailSet)
 {
     this.ContentType = "application/json";
     this.Method = "PUT";
     var entity = await this.SendAsync<ThumbnailSet>(thumbnailSet);
     this.InitializeCollectionProperties(entity);
     return entity;
 }
 /// <summary>
 /// Creates the specified ThumbnailSet using PUT.
 /// </summary>
 /// <param name="thumbnailSetToCreate">The ThumbnailSet to create.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created ThumbnailSet.</returns>
 public async System.Threading.Tasks.Task<ThumbnailSet> CreateAsync(ThumbnailSet thumbnailSetToCreate, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method = "PUT";
     var newEntity = await this.SendAsync<ThumbnailSet>(thumbnailSetToCreate, cancellationToken).ConfigureAwait(false);
     this.InitializeCollectionProperties(newEntity);
     return newEntity;
 }
Пример #4
0
        /// <summary>
        /// Creates the specified ThumbnailSet using PUT.
        /// </summary>
        /// <param name="thumbnailSetToCreate">The ThumbnailSet to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created ThumbnailSet.</returns>
        public async System.Threading.Tasks.Task <ThumbnailSet> CreateAsync(ThumbnailSet thumbnailSetToCreate, CancellationToken cancellationToken)
        {
            this.ContentType = "application/json";
            this.Method      = "PUT";
            var newEntity = await this.SendAsync <ThumbnailSet>(thumbnailSetToCreate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(newEntity);
            return(newEntity);
        }
Пример #5
0
        /// <summary>
        /// Updates the specified ThumbnailSet using PATCH.
        /// </summary>
        /// <param name="thumbnailSet">The ThumbnailSet to update.</param>
        /// <returns>The updated ThumbnailSet.</returns>
        public async Task <ThumbnailSet> UpdateAsync(ThumbnailSet thumbnailSet)
        {
            this.ContentType = "application/json";
            this.Method      = "PATCH";
            var entity = await this.SendAsync <ThumbnailSet>(thumbnailSet);

            this.InitializeCollectionProperties(entity);
            return(entity);
        }
Пример #6
0
 /// <summary>
 /// Creates the specified ThumbnailSet using PUT.
 /// </summary>
 /// <param name="thumbnailSetToCreate">The ThumbnailSet to create.</param>
 /// <returns>The created ThumbnailSet.</returns>
 public System.Threading.Tasks.Task <ThumbnailSet> CreateAsync(ThumbnailSet thumbnailSetToCreate)
 {
     return(this.CreateAsync(thumbnailSetToCreate, CancellationToken.None));
 }
Пример #7
0
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="thumbnailSetToInitialize">The <see cref="ThumbnailSet"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(ThumbnailSet thumbnailSetToInitialize)
 {
 }
Пример #8
0
 /// <summary>
 /// Adds the specified ThumbnailSet to the collection via POST.
 /// </summary>
 /// <param name="thumbnailSet">The ThumbnailSet to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created ThumbnailSet.</returns>
 public System.Threading.Tasks.Task <ThumbnailSet> AddAsync(ThumbnailSet thumbnailSet, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method      = "POST";
     return(this.SendAsync <ThumbnailSet>(thumbnailSet, cancellationToken));
 }
Пример #9
0
 /// <summary>
 /// Adds the specified ThumbnailSet to the collection via POST.
 /// </summary>
 /// <param name="thumbnailSet">The ThumbnailSet to add.</param>
 /// <returns>The created ThumbnailSet.</returns>
 public System.Threading.Tasks.Task <ThumbnailSet> AddAsync(ThumbnailSet thumbnailSet)
 {
     return(this.AddAsync(thumbnailSet, CancellationToken.None));
 }
        public void ThumbnailSetExtensions_CustomThumbnailNotFound()
        {
            var expectedThumbnail = new Thumbnail { Url = "https://localhost" };
            var thumbnailSet = new ThumbnailSet
            {
                AdditionalData = new Dictionary<string, object>
                {
                    { "custom", expectedThumbnail }
                }
            };

            var thumbnail = thumbnailSet["custom2"];

            Assert.IsNull(thumbnail, "Unexpected thumbnail returned.");
        }
        public void ThumbnailSetExtensions_AdditionalDataNull()
        {
            var thumbnailSet = new ThumbnailSet();

            var thumbnail = thumbnailSet["custom"];

            Assert.IsNull(thumbnail, "Unexpected thumbnail returned.");
        }
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="thumbnailSet">The <see cref="ThumbnailSet"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(ThumbnailSet thumbnailSet)
 {
 
 }
 /// <summary>
 /// Creates the specified ThumbnailSet using PUT.
 /// </summary>
 /// <param name="thumbnailSetToCreate">The ThumbnailSet to create.</param>
 /// <returns>The created ThumbnailSet.</returns>
 public System.Threading.Tasks.Task<ThumbnailSet> CreateAsync(ThumbnailSet thumbnailSetToCreate)
 {
     return this.CreateAsync(thumbnailSetToCreate, CancellationToken.None);
 }
 /// <summary>
 /// Adds the specified ThumbnailSet to the collection via POST.
 /// </summary>
 /// <param name="thumbnailSet">The ThumbnailSet to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created ThumbnailSet.</returns>
 public System.Threading.Tasks.Task<ThumbnailSet> AddAsync(ThumbnailSet thumbnailSet, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method = "POST";
     return this.SendAsync<ThumbnailSet>(thumbnailSet, cancellationToken);
 }
 /// <summary>
 /// Adds the specified ThumbnailSet to the collection via POST.
 /// </summary>
 /// <param name="thumbnailSet">The ThumbnailSet to add.</param>
 /// <returns>The created ThumbnailSet.</returns>
 public System.Threading.Tasks.Task<ThumbnailSet> AddAsync(ThumbnailSet thumbnailSet)
 {
     return this.AddAsync(thumbnailSet, CancellationToken.None);
 }