Beispiel #1
0
        /// <summary>
        /// Gets a paged list of forms in a forms library.
        /// </summary>
        /// <exception cref="DocuSign.Rooms.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId"></param>/// <param name="formLibraryId">Library Id</param>

        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>Task of FormSummaryList</returns>
        public async System.Threading.Tasks.Task <FormSummaryList> GetFormLibraryFormsAsync(string accountId, Guid?formLibraryId, FormLibrariesApi.GetFormLibraryFormsOptions options = null)
        {
            ApiResponse <FormSummaryList> localVarResponse = await GetFormLibraryFormsAsyncWithHttpInfo(accountId, formLibraryId, options);

            return(localVarResponse.Data);
        }
Beispiel #2
0
        /// <summary>
        /// Gets a paged list of forms in a forms library.
        /// </summary>
        /// <exception cref="DocuSign.Rooms.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId"></param>/// <param name="formLibraryId">Library Id</param>

        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>Task of ApiResponse (FormSummaryList)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <FormSummaryList> > GetFormLibraryFormsAsyncWithHttpInfo(string accountId, Guid?formLibraryId, FormLibrariesApi.GetFormLibraryFormsOptions options = null)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
            {
                throw new ApiException(400, "Missing required parameter 'accountId' when calling FormLibrariesApi->GetFormLibraryForms");
            }
            // verify the required parameter 'formLibraryId' is set
            if (formLibraryId == null)
            {
                throw new ApiException(400, "Missing required parameter 'formLibraryId' when calling FormLibrariesApi->GetFormLibraryForms");
            }

            var    localVarPath         = "/v2/accounts/{accountId}/form_libraries/{formLibraryId}/forms";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new Dictionary <String, String>();
            var    localVarHeaderParams = new Dictionary <String, String>(this.ApiClient.Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType    = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "text/plain",
                "application/json",
                "text/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null)
            {
                localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId));                    // path parameter
            }
            if (formLibraryId != null)
            {
                localVarPathParams.Add("formLibraryId", this.ApiClient.ParameterToString(formLibraryId));                        // path parameter
            }
            if (options != null)
            {
                if (options.count != null)
                {
                    localVarQueryParams.Add("count", this.ApiClient.ParameterToString(options.count));                        // query parameter
                }
                if (options.startPosition != null)
                {
                    localVarQueryParams.Add("startPosition", this.ApiClient.ParameterToString(options.startPosition));                                // query parameter
                }
            }


            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse)await this.ApiClient.CallApiAsync(localVarPath,
                                                                                              Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                              localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("GetFormLibraryForms", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <FormSummaryList>(localVarStatusCode,
                                                     localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                     (FormSummaryList)this.ApiClient.Deserialize(localVarResponse, typeof(FormSummaryList))));
        }
Beispiel #3
0
        /// <summary>
        /// Gets a paged list of forms in a forms library.
        /// </summary>
        /// <exception cref="DocuSign.Rooms.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId"></param>/// <param name="formLibraryId">Library Id</param>

        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>FormSummaryList</returns>
        public FormSummaryList GetFormLibraryForms(string accountId, Guid?formLibraryId, FormLibrariesApi.GetFormLibraryFormsOptions options = null)
        {
            ApiResponse <FormSummaryList> localVarResponse = GetFormLibraryFormsWithHttpInfo(accountId, formLibraryId, options);

            return(localVarResponse.Data);
        }