/// <summary> /// Creates the specified Share using PUT. /// </summary> /// <param name="shareToCreate">The Share to create.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created Share.</returns> public async System.Threading.Tasks.Task<Share> CreateAsync(Share shareToCreate, CancellationToken cancellationToken) { this.ContentType = "application/json"; this.Method = "PUT"; var newEntity = await this.SendAsync<Share>(shareToCreate, cancellationToken).ConfigureAwait(false); this.InitializeCollectionProperties(newEntity); return newEntity; }
/// <summary> /// Creates the specified Share using PUT. /// </summary> /// <param name="share">The Share to create.</param> /// <returns>The created Share.</returns> public async Task<Share> CreateAsync(Share share) { this.ContentType = "application/json"; this.Method = "PUT"; var entity = await this.SendAsync<Share>(share); this.InitializeCollectionProperties(entity); return entity; }
/// <summary> /// Creates the specified Share using PUT. /// </summary> /// <param name="shareToCreate">The Share to create.</param> /// <returns>The created Share.</returns> public System.Threading.Tasks.Task <Share> CreateAsync(Share shareToCreate) { return(this.CreateAsync(shareToCreate, CancellationToken.None)); }
/// <summary> /// Creates the specified Share using PUT. /// </summary> /// <param name="shareToCreate">The Share to create.</param> /// <returns>The created Share.</returns> public System.Threading.Tasks.Task<Share> CreateAsync(Share shareToCreate) { return this.CreateAsync(shareToCreate, CancellationToken.None); }
/// <summary> /// Initializes any collection properties after deserialization, like next requests for paging. /// </summary> /// <param name="shareToInitialize">The <see cref="Share"/> with the collection properties to initialize.</param> private void InitializeCollectionProperties(Share shareToInitialize) { if (shareToInitialize != null && shareToInitialize.AdditionalData != null) { if (shareToInitialize.Items != null && shareToInitialize.Items.CurrentPage != null) { shareToInitialize.Items.AdditionalData = shareToInitialize.AdditionalData; object nextPageLink; shareToInitialize.AdditionalData.TryGetValue("*****@*****.**", out nextPageLink); var nextPageLinkString = nextPageLink as string; if (!string.IsNullOrEmpty(nextPageLinkString)) { shareToInitialize.Items.InitializeNextPageRequest( this.Client, nextPageLinkString); } } } }
/// <summary> /// Adds the specified Share to the collection via POST. /// </summary> /// <param name="share">The Share to add.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created Share.</returns> public System.Threading.Tasks.Task <Share> AddAsync(Share share, CancellationToken cancellationToken) { this.ContentType = "application/json"; this.Method = "POST"; return(this.SendAsync <Share>(share, cancellationToken)); }
/// <summary> /// Adds the specified Share to the collection via POST. /// </summary> /// <param name="share">The Share to add.</param> /// <returns>The created Share.</returns> public System.Threading.Tasks.Task <Share> AddAsync(Share share) { return(this.AddAsync(share, CancellationToken.None)); }
/// <summary> /// Adds the specified Share to the collection via POST. /// </summary> /// <param name="share">The Share to add.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created Share.</returns> public System.Threading.Tasks.Task<Share> AddAsync(Share share, CancellationToken cancellationToken) { this.ContentType = "application/json"; this.Method = "POST"; return this.SendAsync<Share>(share, cancellationToken); }
/// <summary> /// Adds the specified Share to the collection via POST. /// </summary> /// <param name="share">The Share to add.</param> /// <returns>The created Share.</returns> public System.Threading.Tasks.Task<Share> AddAsync(Share share) { return this.AddAsync(share, CancellationToken.None); }