Ejemplo n.º 1
0
 internal RequestBuilder(CloudPTClient.AccessRestrictions securityMode)
 {
     Restrictions = securityMode;
 }
Ejemplo n.º 2
0
 public void Teardown()
 {
     client = null;
 }
Ejemplo n.º 3
0
        internal RestRequest BuildMetadataShareRequest(string shareId, string path, int fileLimit, CloudPTClient.MetadataShareOrderBy sortOrder, bool orderAscending, string cursor, string mimeType)
        {
            RestRequest request = new RestRequest(string.Format("{0}/{1}", _apiUrl, "{version}/MetadataShare/{shareId}/{path}"));

            request.AddUrlSegment("version", _apiVer);
            request.AddUrlSegment("shareId", shareId);
            request.AddUrlSegment("path", path);

            if (fileLimit != 10000)
                request.AddParameter("file_limit", fileLimit);

            switch (sortOrder)
            {
                case CloudPTClient.MetadataShareOrderBy.ModifiedDate:
                    request.AddParameter("order_by", "mtime");
                    break;
                case CloudPTClient.MetadataShareOrderBy.MimeType:
                    request.AddParameter("order_by", "mime_type");
                    break;
                case CloudPTClient.MetadataShareOrderBy.Size:
                    request.AddParameter("order_by", "size");
                    break;
                case CloudPTClient.MetadataShareOrderBy.Folder:
                    request.AddParameter("order_by", "folder");
                    break;
                default:
                case CloudPTClient.MetadataShareOrderBy.Name:
                    request.AddParameter("order_by", "name");
                    break;
            }

            if (!orderAscending)
                request.AddParameter("order_ascending", false);

            if (!string.IsNullOrWhiteSpace(cursor))
                request.AddParameter("cursor", cursor);

            if (!string.IsNullOrWhiteSpace(mimeType))
                request.AddParameter("mime_type", mimeType);

            return request;
        }
Ejemplo n.º 4
0
 public void SetUpClient()
 {
     client = new CloudPTClient(ApiCredentials.consumerKey, ApiCredentials.consumerSecret, CloudPTClient.AccessRestrictions.CloudPT);
 }