|
| 1 | +// <auto-generated> |
| 2 | +// Auto-generated by StoneAPI, do not modify. |
| 3 | +// </auto-generated> |
| 4 | + |
| 5 | +namespace Dropbox.Api.Sharing.Routes |
| 6 | +{ |
| 7 | + using sys = System; |
| 8 | + using io = System.IO; |
| 9 | + using col = System.Collections.Generic; |
| 10 | + using t = System.Threading.Tasks; |
| 11 | + using enc = Dropbox.Api.Stone; |
| 12 | + |
| 13 | + /// <summary> |
| 14 | + /// <para>The routes for the <see cref="N:Dropbox.Api.Sharing"/> namespace</para> |
| 15 | + /// </summary> |
| 16 | + public class SharingAppRoutes |
| 17 | + { |
| 18 | + /// <summary> |
| 19 | + /// <para>Initializes a new instance of the <see cref="SharingAppRoutes" /> |
| 20 | + /// class.</para> |
| 21 | + /// </summary> |
| 22 | + /// <param name="transport">The transport to use</param> |
| 23 | + internal SharingAppRoutes(enc.ITransport transport) |
| 24 | + { |
| 25 | + this.Transport = transport; |
| 26 | + } |
| 27 | + |
| 28 | + /// <summary> |
| 29 | + /// <para>Gets the transport used for these routes</para> |
| 30 | + /// </summary> |
| 31 | + internal enc.ITransport Transport { get; private set; } |
| 32 | + |
| 33 | + /// <summary> |
| 34 | + /// <para>Get the shared link's metadata.</para> |
| 35 | + /// </summary> |
| 36 | + /// <param name="getSharedLinkMetadataArg">The request parameters</param> |
| 37 | + /// <returns>The task that represents the asynchronous send operation. The TResult |
| 38 | + /// parameter contains the response from the server.</returns> |
| 39 | + /// <exception cref="Dropbox.Api.ApiException{TError}">Thrown if there is an error |
| 40 | + /// processing the request; This will contain a <see |
| 41 | + /// cref="SharedLinkError"/>.</exception> |
| 42 | + public t.Task<SharedLinkMetadata> GetSharedLinkMetadataAsync(GetSharedLinkMetadataArg getSharedLinkMetadataArg) |
| 43 | + { |
| 44 | + return this.Transport.SendRpcRequestAsync<GetSharedLinkMetadataArg, SharedLinkMetadata, SharedLinkError>(getSharedLinkMetadataArg, "api", "/sharing/get_shared_link_metadata", "app", global::Dropbox.Api.Sharing.GetSharedLinkMetadataArg.Encoder, global::Dropbox.Api.Sharing.SharedLinkMetadata.Decoder, global::Dropbox.Api.Sharing.SharedLinkError.Decoder); |
| 45 | + } |
| 46 | + |
| 47 | + /// <summary> |
| 48 | + /// <para>Begins an asynchronous send to the get shared link metadata route.</para> |
| 49 | + /// </summary> |
| 50 | + /// <param name="getSharedLinkMetadataArg">The request parameters.</param> |
| 51 | + /// <param name="callback">The method to be called when the asynchronous send is |
| 52 | + /// completed.</param> |
| 53 | + /// <param name="state">A user provided object that distinguished this send from other |
| 54 | + /// send requests.</param> |
| 55 | + /// <returns>An object that represents the asynchronous send request.</returns> |
| 56 | + public sys.IAsyncResult BeginGetSharedLinkMetadata(GetSharedLinkMetadataArg getSharedLinkMetadataArg, sys.AsyncCallback callback, object state = null) |
| 57 | + { |
| 58 | + var task = this.GetSharedLinkMetadataAsync(getSharedLinkMetadataArg); |
| 59 | + |
| 60 | + return enc.Util.ToApm(task, callback, state); |
| 61 | + } |
| 62 | + |
| 63 | + /// <summary> |
| 64 | + /// <para>Get the shared link's metadata.</para> |
| 65 | + /// </summary> |
| 66 | + /// <param name="url">URL of the shared link.</param> |
| 67 | + /// <param name="path">If the shared link is to a folder, this parameter can be used to |
| 68 | + /// retrieve the metadata for a specific file or sub-folder in this folder. A relative |
| 69 | + /// path should be used.</param> |
| 70 | + /// <param name="linkPassword">If the shared link has a password, this parameter can be |
| 71 | + /// used.</param> |
| 72 | + /// <returns>The task that represents the asynchronous send operation. The TResult |
| 73 | + /// parameter contains the response from the server.</returns> |
| 74 | + /// <exception cref="Dropbox.Api.ApiException{TError}">Thrown if there is an error |
| 75 | + /// processing the request; This will contain a <see |
| 76 | + /// cref="SharedLinkError"/>.</exception> |
| 77 | + public t.Task<SharedLinkMetadata> GetSharedLinkMetadataAsync(string url, |
| 78 | + string path = null, |
| 79 | + string linkPassword = null) |
| 80 | + { |
| 81 | + var getSharedLinkMetadataArg = new GetSharedLinkMetadataArg(url, |
| 82 | + path, |
| 83 | + linkPassword); |
| 84 | + |
| 85 | + return this.GetSharedLinkMetadataAsync(getSharedLinkMetadataArg); |
| 86 | + } |
| 87 | + |
| 88 | + /// <summary> |
| 89 | + /// <para>Begins an asynchronous send to the get shared link metadata route.</para> |
| 90 | + /// </summary> |
| 91 | + /// <param name="url">URL of the shared link.</param> |
| 92 | + /// <param name="path">If the shared link is to a folder, this parameter can be used to |
| 93 | + /// retrieve the metadata for a specific file or sub-folder in this folder. A relative |
| 94 | + /// path should be used.</param> |
| 95 | + /// <param name="linkPassword">If the shared link has a password, this parameter can be |
| 96 | + /// used.</param> |
| 97 | + /// <param name="callback">The method to be called when the asynchronous send is |
| 98 | + /// completed.</param> |
| 99 | + /// <param name="callbackState">A user provided object that distinguished this send |
| 100 | + /// from other send requests.</param> |
| 101 | + /// <returns>An object that represents the asynchronous send request.</returns> |
| 102 | + public sys.IAsyncResult BeginGetSharedLinkMetadata(string url, |
| 103 | + string path = null, |
| 104 | + string linkPassword = null, |
| 105 | + sys.AsyncCallback callback = null, |
| 106 | + object callbackState = null) |
| 107 | + { |
| 108 | + var getSharedLinkMetadataArg = new GetSharedLinkMetadataArg(url, |
| 109 | + path, |
| 110 | + linkPassword); |
| 111 | + |
| 112 | + return this.BeginGetSharedLinkMetadata(getSharedLinkMetadataArg, callback, callbackState); |
| 113 | + } |
| 114 | + |
| 115 | + /// <summary> |
| 116 | + /// <para>Waits for the pending asynchronous send to the get shared link metadata route |
| 117 | + /// to complete</para> |
| 118 | + /// </summary> |
| 119 | + /// <param name="asyncResult">The reference to the pending asynchronous send |
| 120 | + /// request</param> |
| 121 | + /// <returns>The response to the send request</returns> |
| 122 | + /// <exception cref="Dropbox.Api.ApiException{TError}">Thrown if there is an error |
| 123 | + /// processing the request; This will contain a <see |
| 124 | + /// cref="SharedLinkError"/>.</exception> |
| 125 | + public SharedLinkMetadata EndGetSharedLinkMetadata(sys.IAsyncResult asyncResult) |
| 126 | + { |
| 127 | + var task = asyncResult as t.Task<SharedLinkMetadata>; |
| 128 | + if (task == null) |
| 129 | + { |
| 130 | + throw new sys.InvalidOperationException(); |
| 131 | + } |
| 132 | + |
| 133 | + return task.Result; |
| 134 | + } |
| 135 | + } |
| 136 | +} |
0 commit comments