/// <summary>
        /// Gets a list of all account tabs. Retrieves a list of all tabs associated with the account.
        /// </summary>
 	    ///<param name="accountId">The external account number (int) or account ID Guid.</param> <param name="options">Options for modifying the behavior of the function.</param>
		/// <returns>7Task of TabMetadataList</returns>
        public async System.Threading.Tasks.Task<TabMetadataList> ListAsync (string accountId, CustomTabsApi.ListOptions options = null)
        {
             ApiResponse<TabMetadataList> response = await ListAsyncWithHttpInfo(accountId, options);
             return response.Data;

        }
        /// <summary>
        /// Gets a list of all account tabs. Retrieves a list of all tabs associated with the account.
        /// </summary>
	    ///<param name="accountId">The external account number (int) or account ID Guid.</param> <param name="options">Options for modifying the behavior of the function.</param>
		/// <returns>8Task of ApiResponse (TabMetadataList)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<TabMetadataList>> ListAsyncWithHttpInfo (string accountId, CustomTabsApi.ListOptions options = null)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null) throw new ApiException(400, "Missing required parameter 'accountId' when calling List");
            
    
            var path_ = "/v2/accounts/{accountId}/tab_definitions";
    
            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 (options != null)
			{
				if (options.customTabOnly != null) queryParams.Add("custom_tab_only", Configuration.ApiClient.ParameterToString(options.customTabOnly)); // query parameter
				
			}
			

            
            
            

            

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

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

            return new ApiResponse<TabMetadataList>(statusCode,
                response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                (TabMetadataList) Configuration.ApiClient.Deserialize(response, typeof(TabMetadataList)));
            
        }
        /// <summary>
        /// Gets a list of all account tabs. Retrieves a list of all tabs associated with the account.
        /// </summary>
 	    ///<param name="accountId">The external account number (int) or account ID Guid.</param> <param name="options">Options for modifying the behavior of the function.</param>
		/// <returns>5TabMetadataList</returns>
        public TabMetadataList List (string accountId, CustomTabsApi.ListOptions options = null)
        {
             ApiResponse<TabMetadataList> response = ListWithHttpInfo(accountId, options);
             return response.Data;
        }