public ItemCopyRequestBuilder(
     string requestUrl,
     IBaseClient client,
     string name = null,
     ItemReference parentReference = null)
     : base(requestUrl, client)
 {
     this.Name = name;
         this.ParentReference = parentReference;
 }
Exemplo n.º 2
0
     /// <summary>
     /// Constructs a new ItemCopyRequest.
     /// </summary>
     public ItemCopyRequest(
         string requestUrl,
         IOneDriveClient oneDriveClient,
         IList<Option> options,
         string name = null,
         ItemReference parentReference = null)
         : base(requestUrl, oneDriveClient, options)
     {
 
         this.Method = "POST";
         this.Headers.Add(new HeaderOption("Prefer", "respond-async"));
         this.ContentType = "application/json";
         this.RequestBody = new ItemCopyRequestBody();
         this.RequestBody.Name = name;
         this.RequestBody.ParentReference = parentReference;
 
     }
 /// <summary>
 /// Gets the request builder for ItemCopy.
 /// </summary>
 /// <returns>The <see cref="IItemCopyRequestBuilder"/>.</returns>
 public IItemCopyRequestBuilder Copy(
     string name,
     ItemReference parentReference)
 {
     return new ItemCopyRequestBuilder(
         this.AppendSegmentToRequestUrl("action.copy"),
         this.Client,
         name,
         parentReference);
 }
 /// <summary>
 /// Gets the request builder for ItemCopy.
 /// </summary>
 /// <returns>The <see cref="IItemCopyRequestBuilder"/>.</returns>
 public IItemCopyRequestBuilder Copy(
     string name = null,
     ItemReference parentReference = null)
 {
     return new ItemCopyRequestBuilder(
         this.AppendSegmentToRequestUrl("oneDrive.copy"),
         this.Client,
         name,
         parentReference);
 }
 /// <summary>
 /// Copy a Microsoft.OneDrive.Sdk.ItemReference to a Graph.ItemReference.
 /// </summary>
 /// <param name="itemReference">Current One Drive ItemReference</param>
 /// <returns>A Graph ItemReference</returns>
 private static Graph.ItemReference CopyTo(this Microsoft.OneDrive.Sdk.ItemReference itemReference)
 {
     return(new Graph.ItemReference {
         AdditionalData = itemReference.AdditionalData, DriveId = itemReference.DriveId, DriveType = "consumer", Id = itemReference.Id, Path = itemReference.Path
     });
 }