/// <summary>
 /// Initializes a new instance of the RequestEventArgs class with specified request, api call, method, signature and POST data.
 /// </summary>
 /// <param name="request">HTTP request</param>
 /// <param name="api_call">Quatrix api call</param>
 /// <param name="method">HTTP method</param>
 /// <param name="signature">Signature subject</param>
 /// <param name="post_data">Data for POST method</param>
 public RequestEventArgs( IQuatrixRequest request, string api_call, string method, string signature, byte[] post_data )
 {
     this.Request = request;
     this.ApiCall = api_call;
     this.Method = method;
     this.Signature = signature;
     this.PostData = post_data;
 }
Пример #2
0
 /// <summary>
 /// Creates the share action.
 /// </summary>
 /// <param name="request">Web request for share action creating.</param>
 /// <param name="parameters">Share parameters.</param>
 /// <returns>Instance of <see cref="ShareAction"/> class which contains information about new share action </returns>
 public ShareAction CreateShareAction( IQuatrixRequest request, ShareParameters parameters )
 {
     return request.CreateShareAction( parameters );
 }
Пример #3
0
 /// <summary>
 /// Creates a share with specified parameters 
 /// </summary>
 /// <param name="api_object">Object which have request data</param>
 /// <param name="parameters">Share parameters</param>
 /// <returns>Link to downloading shared files </returns>
 public string CreateShare( IQuatrixRequest request, ShareParameters parameters )
 {
     return request.CreateShare( parameters );
 }
 private static Metadata ReturnMetadata( IQuatrixRequest request, string id, out JToken content )
 {
     content = null;
     request.Enable();                                                   //check if request not null
     string uri = string.Format( "/file/metadata/{0}", id );             //create uri for get metadata by id
     string json = request.CreateRequest( uri );
     Metadata metadata = request.ToEntity<Metadata>( json );
     content = JToken.Parse( json )["content"];                      //if request result OK, parse result
     return metadata;
 }
 private static Metadata ReturnMetadata( IQuatrixRequest request, string id )
 {
     JToken content;
     Metadata result = ReturnMetadata( request, id, out content );
     if (content != null) {
         result.Content = ConvertContentToChilds( content, request );
     }
     return result;
 }
 private static string GetDwnLink( IQuatrixRequest request, string[] ids )
 {
     request.Enable();
     string api_call = "/file/downloadlink";
     return request.CreateRequest( api_call, Parameters.GetDownloadLink( ids ) );
 }
 private static List<Metadata> ConvertContentToChilds( JToken content, IQuatrixRequest request )
 {
     return content.Select( c => {
         var mtd = c.ToObject<Metadata>();
         mtd.Request = request;
         return mtd;
     } ).ToList();
 }