Example #1
0
        public static IPolicyLocationItem CreateFolder(IAssetService2 assetServiceClient, ItemId parentId, string name, string desc)
        {
            Folder testFolder = new Folder();
            testFolder.Name = name;
            testFolder.Description = desc;
            testFolder.ItemId = new ItemId();
            testFolder.AssetType = Workshare.Server.Proxies.Asset2Proxy.Type.Policy;
            testFolder.ParentFolderId = parentId;

            FoldersRequest request = new FoldersRequest();
            request.Folders = new Folders();
            request.Folders.Add(testFolder);

            FoldersResponse response = assetServiceClient.CreateFolders(request);
            if (0 == response.Folders.Count)
                throw new Exception("Failed to create test folder");

			return FindFolder(assetServiceClient, response.Folders[0].Path);
        }
        /// <summary>
        /// Moves an envelope from its current folder to the specified folder. Moves an envelope from its current folder to the specified folder.\n\n### Note: You can use this endpoint to delete envelopes by specifying `recyclebin&#39; in the `folderId` parameter of the endpoint. Placing an in process envelope (envelope status of `sent` or `delivered`) in the recycle bin voids the envelope. You can also use this endpoint to delete templates by specifying a template ID instead of an envelope ID in the &#39;envelopeIds&#39; property and specifying `recyclebin` in the `folderId` parameter.
        /// </summary>
	    ///<param name="accountId">The external account number (int) or account ID Guid.</param><param name="folderId">The ID of the folder being accessed.</param> <param name="foldersRequest">TBD Description</param>
		/// <returns>8Task of ApiResponse (FoldersResponse)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<FoldersResponse>> MoveEnvelopesAsyncWithHttpInfo (string accountId, string folderId, FoldersRequest foldersRequest)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null) throw new ApiException(400, "Missing required parameter 'accountId' when calling MoveEnvelopes");
            // verify the required parameter 'folderId' is set
            if (folderId == null) throw new ApiException(400, "Missing required parameter 'folderId' when calling MoveEnvelopes");
            
    
            var path_ = "/v2/accounts/{accountId}/folders/{folderId}";
    
            var pathParams = new Dictionary<String, String>();
            var queryParams = new Dictionary<String, String>();
            var headerParams = new Dictionary<String, String>();
            var formParams = new Dictionary<String, String>();
            var fileParams = new Dictionary<String, FileParameter>();
            String postBody = null;

            // to determine the Accept header
            String[] http_header_accepts = new String[] {
                "application/json"
            };
            String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts);
            if (http_header_accept != null)
                headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts));

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            pathParams.Add("format", "json");
            if (accountId != null) pathParams.Add("accountId", Configuration.ApiClient.ParameterToString(accountId)); // path parameter
            if (folderId != null) pathParams.Add("folderId", Configuration.ApiClient.ParameterToString(folderId)); // path parameter
            

						
			
			

            
            
            postBody = Configuration.ApiClient.Serialize(foldersRequest); // http body (model) parameter
            

            

            // make the HTTP request
            IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams);

            int statusCode = (int) response.StatusCode;
 
            if (statusCode >= 400)
                throw new ApiException (statusCode, "Error calling MoveEnvelopes: " + response.Content, response.Content);
            else if (statusCode == 0)
                throw new ApiException (statusCode, "Error calling MoveEnvelopes: " + response.ErrorMessage, response.ErrorMessage);

            return new ApiResponse<FoldersResponse>(statusCode,
                response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                (FoldersResponse) Configuration.ApiClient.Deserialize(response, typeof(FoldersResponse)));
            
        }
        /// <summary>
        /// Moves an envelope from its current folder to the specified folder. Moves an envelope from its current folder to the specified folder.\n\n### Note: You can use this endpoint to delete envelopes by specifying `recyclebin&#39; in the `folderId` parameter of the endpoint. Placing an in process envelope (envelope status of `sent` or `delivered`) in the recycle bin voids the envelope. You can also use this endpoint to delete templates by specifying a template ID instead of an envelope ID in the &#39;envelopeIds&#39; property and specifying `recyclebin` in the `folderId` parameter.
        /// </summary>
 	    ///<param name="accountId">The external account number (int) or account ID Guid.</param><param name="folderId">The ID of the folder being accessed.</param> <param name="foldersRequest">TBD Description</param>
		/// <returns>7Task of FoldersResponse</returns>
        public async System.Threading.Tasks.Task<FoldersResponse> MoveEnvelopesAsync (string accountId, string folderId, FoldersRequest foldersRequest)
        {
             ApiResponse<FoldersResponse> response = await MoveEnvelopesAsyncWithHttpInfo(accountId, folderId, foldersRequest);
             return response.Data;

        }
        /// <summary>
        /// Moves an envelope from its current folder to the specified folder. Moves an envelope from its current folder to the specified folder.\n\n### Note: You can use this endpoint to delete envelopes by specifying `recyclebin&#39; in the `folderId` parameter of the endpoint. Placing an in process envelope (envelope status of `sent` or `delivered`) in the recycle bin voids the envelope. You can also use this endpoint to delete templates by specifying a template ID instead of an envelope ID in the &#39;envelopeIds&#39; property and specifying `recyclebin` in the `folderId` parameter.
        /// </summary>
 	    ///<param name="accountId">The external account number (int) or account ID Guid.</param><param name="folderId">The ID of the folder being accessed.</param> <param name="foldersRequest">TBD Description</param>
		/// <returns>5FoldersResponse</returns>
        public FoldersResponse MoveEnvelopes (string accountId, string folderId, FoldersRequest foldersRequest)
        {
             ApiResponse<FoldersResponse> response = MoveEnvelopesWithHttpInfo(accountId, folderId, foldersRequest);
             return response.Data;
        }