예제 #1
0
        internal void CreateCustomTabsFromCSV(String tabType, String tabLabel, String tabToolTip, String tabAnchor)
        {
            CheckToken();

            CustomTabsApi customTab = new CustomTabsApi();
            TabMetadata   meta      = new TabMetadata();

            meta.Type     = tabType;
            meta.TabLabel = tabLabel;
            meta.Name     = tabToolTip;//Optional
            meta.Anchor   = tabAnchor;

            customTab.Create(AccountID, meta);
        }
        public void ConvertAPluginMetadataObject()
        {
            var metadata = new TabMetadata {
                DocumentationUri = "anything"
            };

            var converter = new TabMetadataConverter();

            var obj = converter.Convert(metadata);

            var result = obj as IDictionary <string, object>;

            Assert.NotNull(result);
            Assert.True(result.ContainsKey("documentationUri"));
            Assert.False(result.ContainsKey("hasMetadata"));
        }
        /// <summary>
        /// Updates custom tab information. Updates the information in a custom tab for the specified account.
        /// </summary>
	    ///<param name="accountId">The external account number (int) or account ID Guid.</param><param name="customTabId"></param> <param name="tabMetadata">TBD Description</param>
		/// <returns>8Task of ApiResponse (TabMetadata)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<TabMetadata>> UpdateAsyncWithHttpInfo (string accountId, string customTabId, TabMetadata tabMetadata)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null) throw new ApiException(400, "Missing required parameter 'accountId' when calling Update");
            // verify the required parameter 'customTabId' is set
            if (customTabId == null) throw new ApiException(400, "Missing required parameter 'customTabId' when calling Update");
            
    
            var path_ = "/v2/accounts/{accountId}/tab_definitions/{customTabId}";
    
            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 (customTabId != null) pathParams.Add("customTabId", Configuration.ApiClient.ParameterToString(customTabId)); // path parameter
            

						
			
			

            
            
            postBody = Configuration.ApiClient.Serialize(tabMetadata); // 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 Update: " + response.Content, response.Content);
            else if (statusCode == 0)
                throw new ApiException (statusCode, "Error calling Update: " + response.ErrorMessage, response.ErrorMessage);

            return new ApiResponse<TabMetadata>(statusCode,
                response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                (TabMetadata) Configuration.ApiClient.Deserialize(response, typeof(TabMetadata)));
            
        }
        /// <summary>
        /// Updates custom tab information. Updates the information in a custom tab for the specified account.
        /// </summary>
 	    ///<param name="accountId">The external account number (int) or account ID Guid.</param><param name="customTabId"></param> <param name="tabMetadata">TBD Description</param>
		/// <returns>7Task of TabMetadata</returns>
        public async System.Threading.Tasks.Task<TabMetadata> UpdateAsync (string accountId, string customTabId, TabMetadata tabMetadata)
        {
             ApiResponse<TabMetadata> response = await UpdateAsyncWithHttpInfo(accountId, customTabId, tabMetadata);
             return response.Data;

        }
        /// <summary>
        /// Updates custom tab information. Updates the information in a custom tab for the specified account.
        /// </summary>
 	    ///<param name="accountId">The external account number (int) or account ID Guid.</param><param name="customTabId"></param> <param name="tabMetadata">TBD Description</param>
		/// <returns>5TabMetadata</returns>
        public TabMetadata Update (string accountId, string customTabId, TabMetadata tabMetadata)
        {
             ApiResponse<TabMetadata> response = UpdateWithHttpInfo(accountId, customTabId, tabMetadata);
             return response.Data;
        }
        /// <summary>
        /// Creates a custom tab. Creates a tab with pre-defined properties, such as a text tab with a certain font type and validation pattern. Users can access the custom tabs when sending documents through the DocuSign web application.\n\nCustom tabs can be created for approve, checkbox, company, date, date signed, decline, email, email address, envelope ID, first name, formula, full name, initial here, last name, list, note, number, radio, sign here, signer attachment, SSN, text, title, and zip tabs.
        /// </summary>
 	    ///<param name="accountId">The external account number (int) or account ID Guid.</param> <param name="tabMetadata">TBD Description</param>
		/// <returns>5TabMetadata</returns>
        public TabMetadata Create (string accountId, TabMetadata tabMetadata)
        {
             ApiResponse<TabMetadata> response = CreateWithHttpInfo(accountId, tabMetadata);
             return response.Data;
        }