public virtual IActionResult DateTimeInfo([FromBody] InputDateTimeInfo dateTimeInfo) { //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(OutputDateInfo)); //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400, default(OutputString)); string exampleJson = null; exampleJson = "{\n \"DayOfYear\" : 25,\n \"DayOfWeek\" : 2,\n \"WeekOfYear\" : 10,\n \"SecondsInDay\" : 1234,\n \"MinutesInDay\" : 359,\n \"Ticks\" : 1234567890\n}"; var example = exampleJson != null ? JsonConvert.DeserializeObject <OutputDateInfo>(exampleJson) : default(OutputDateInfo); //TODO: Change the data returned return(new ObjectResult(example)); }
/// <summary> /// DateTime - Get date and time information Retrieve useful date and time information, such as day of year, total seconds and ticks /// </summary> /// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="dateTimeInfo"> (optional)</param> /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> /// <returns>Task of OutputDateInfo</returns> public async System.Threading.Tasks.Task <OutputDateInfo> DateTimeInfoAsync(InputDateTimeInfo dateTimeInfo = default(InputDateTimeInfo), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.ApiResponse <OutputDateInfo> localVarResponse = await DateTimeInfoWithHttpInfoAsync(dateTimeInfo, cancellationToken).ConfigureAwait(false); return(localVarResponse.Data); }
/// <summary> /// DateTime - Get date and time information Retrieve useful date and time information, such as day of year, total seconds and ticks /// </summary> /// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="dateTimeInfo"> (optional)</param> /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> /// <returns>Task of ApiResponse (OutputDateInfo)</returns> public async System.Threading.Tasks.Task <Org.OpenAPITools.Client.ApiResponse <OutputDateInfo> > DateTimeInfoWithHttpInfoAsync(InputDateTimeInfo dateTimeInfo = default(InputDateTimeInfo), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); String[] _contentTypes = new String[] { "application/json" }; // to determine the Accept header String[] _accepts = new String[] { "application/json" }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.Data = dateTimeInfo; // authentication (apiKeyHeader) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("X-IBM-Client-Id"))) { localVarRequestOptions.HeaderParameters.Add("X-IBM-Client-Id", this.Configuration.GetApiKeyWithPrefix("X-IBM-Client-Id")); } // make the HTTP request var localVarResponse = await this.AsynchronousClient.PostAsync <OutputDateInfo>("/DateTimeInfo", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DateTimeInfo", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// DateTime - Get date and time information Retrieve useful date and time information, such as day of year, total seconds and ticks /// </summary> /// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="dateTimeInfo"> (optional)</param> /// <returns>OutputDateInfo</returns> public OutputDateInfo DateTimeInfo(InputDateTimeInfo dateTimeInfo = default(InputDateTimeInfo)) { Org.OpenAPITools.Client.ApiResponse <OutputDateInfo> localVarResponse = DateTimeInfoWithHttpInfo(dateTimeInfo); return(localVarResponse.Data); }