Exemple #1
0
        public virtual IActionResult WorldTime([FromBody] InputDateTimeConversion dateTimeConversion)
        {
            //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(OutputString));
            //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  \"result\" : \"string\"\n}";

            var example = exampleJson != null
            ? JsonConvert.DeserializeObject <OutputString>(exampleJson)
            : default(OutputString);

            //TODO: Change the data returned
            return(new ObjectResult(example));
        }
Exemple #2
0
        /// <summary>
        /// DateTime - Get world time Convert date and time from one time zone to another
        /// </summary>
        /// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="dateTimeConversion"> (optional)</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of OutputString</returns>
        public async System.Threading.Tasks.Task <OutputString> WorldTimeAsync(InputDateTimeConversion dateTimeConversion = default(InputDateTimeConversion), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Org.OpenAPITools.Client.ApiResponse <OutputString> localVarResponse = await WorldTimeWithHttpInfoAsync(dateTimeConversion, cancellationToken).ConfigureAwait(false);

            return(localVarResponse.Data);
        }
Exemple #3
0
        /// <summary>
        /// DateTime - Get world time Convert date and time from one time zone to another
        /// </summary>
        /// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="dateTimeConversion"> (optional)</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (OutputString)</returns>
        public async System.Threading.Tasks.Task <Org.OpenAPITools.Client.ApiResponse <OutputString> > WorldTimeWithHttpInfoAsync(InputDateTimeConversion dateTimeConversion = default(InputDateTimeConversion), 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 = dateTimeConversion;

            // 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 <OutputString>("/WorldTime", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("WorldTime", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Exemple #4
0
 /// <summary>
 /// DateTime - Get world time Convert date and time from one time zone to another
 /// </summary>
 /// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="dateTimeConversion"> (optional)</param>
 /// <returns>OutputString</returns>
 public OutputString WorldTime(InputDateTimeConversion dateTimeConversion = default(InputDateTimeConversion))
 {
     Org.OpenAPITools.Client.ApiResponse <OutputString> localVarResponse = WorldTimeWithHttpInfo(dateTimeConversion);
     return(localVarResponse.Data);
 }