DocuSign.Rooms by DocuSign

<PackageReference Include="DocuSign.Rooms" Version="1.2.0-rc" />

 TaskDateTypesApi

Represents a collection of functions to interact with the API endpoints
using DocuSign.Rooms.Client; using DocuSign.Rooms.Model; using RestSharp; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Runtime.CompilerServices; using System.Threading.Tasks; namespace DocuSign.Rooms.Api { public class TaskDateTypesApi : ITaskDateTypesApi, IApiAccessor { private ExceptionFactory _exceptionFactory = (string name, IRestResponse response) => null; public ApiClient ApiClient { get; set; } public ExceptionFactory ExceptionFactory { get { if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); return _exceptionFactory; } set { _exceptionFactory = value; } } public TaskDateTypesApi(ApiClient aplClient) { ApiClient = aplClient; ExceptionFactory = Configuration.DefaultExceptionFactory; } public string GetBasePath() { return ApiClient.RestClient.BaseUrl.ToString(); } public GlobalTaskDateTypes GetTaskDateTypes() { ApiResponse<GlobalTaskDateTypes> taskDateTypesWithHttpInfo = GetTaskDateTypesWithHttpInfo(); return taskDateTypesWithHttpInfo.Data; } public ApiResponse<GlobalTaskDateTypes> GetTaskDateTypesWithHttpInfo() { string path = "/v2/task_date_types"; Dictionary<string, string> dictionary = new Dictionary<string, string>(); Dictionary<string, string> queryParams = new Dictionary<string, string>(); Dictionary<string, string> dictionary2 = new Dictionary<string, string>(ApiClient.Configuration.DefaultHeader); Dictionary<string, string> formParams = new Dictionary<string, string>(); Dictionary<string, FileParameter> fileParams = new Dictionary<string, FileParameter>(); object postBody = null; string[] contentTypes = new string[4] { "application/json-patch+json", "application/json", "text/json", "application/_*+json" }; string contentType = ApiClient.SelectHeaderContentType(contentTypes); string[] accepts = new string[3] { "text/plain", "application/json", "text/json" }; string text = ApiClient.SelectHeaderAccept(accepts); if (text != null) dictionary2.Add("Accept", text); dictionary.Add("format", "json"); if (!string.IsNullOrEmpty(ApiClient.Configuration.AccessToken)) dictionary2["Authorization"] = "Bearer " + ApiClient.Configuration.AccessToken; IRestResponse restResponse = (IRestResponse)ApiClient.CallApi(path, Method.GET, queryParams, postBody, dictionary2, formParams, fileParams, dictionary, contentType); int statusCode = (int)restResponse.StatusCode; if (ExceptionFactory != null) { Exception ex = ExceptionFactory("GetTaskDateTypes", restResponse); if (ex != null) throw ex; } if (restResponse.ContentType == null || restResponse.ContentType.ToLower().Contains("json")) return new ApiResponse<GlobalTaskDateTypes>(statusCode, restResponse.Headers.ToDictionary((Parameter x) => x.Name, (Parameter x) => x.Value.ToString()), (GlobalTaskDateTypes)ApiClient.Deserialize(restResponse, typeof(GlobalTaskDateTypes))); return new ApiResponse<GlobalTaskDateTypes>(statusCode, restResponse.Headers.ToDictionary((Parameter x) => x.Name, (Parameter x) => x.Value.ToString()), (GlobalTaskDateTypes)ApiClient.Deserialize(restResponse.RawBytes, typeof(GlobalTaskDateTypes))); } [AsyncStateMachine(typeof(<GetTaskDateTypesAsync>d__12))] [DebuggerStepThrough] public Task<GlobalTaskDateTypes> GetTaskDateTypesAsync() { <GetTaskDateTypesAsync>d__12 stateMachine = new <GetTaskDateTypesAsync>d__12(); stateMachine.<>t__builder = AsyncTaskMethodBuilder<GlobalTaskDateTypes>.Create(); stateMachine.<>4__this = this; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } [AsyncStateMachine(typeof(<GetTaskDateTypesAsyncWithHttpInfo>d__13))] [DebuggerStepThrough] public Task<ApiResponse<GlobalTaskDateTypes>> GetTaskDateTypesAsyncWithHttpInfo() { <GetTaskDateTypesAsyncWithHttpInfo>d__13 stateMachine = new <GetTaskDateTypesAsyncWithHttpInfo>d__13(); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ApiResponse<GlobalTaskDateTypes>>.Create(); stateMachine.<>4__this = this; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } } }