class CloudmersiveValidateApiClient::DateTimeApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/cloudmersive-validate-api-client/api/date_time_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

date_time_get_now_simple(opts = {}) click to toggle source

Get current date and time as of now Gets the current date and time. Response time is syncronized with atomic clocks, and represents a monotonic, centrally available, consistent clock. @param [Hash] opts the optional parameters @return [DateTimeNowResult]

# File lib/cloudmersive-validate-api-client/api/date_time_api.rb, line 26
def date_time_get_now_simple(opts = {})
  data, _status_code, _headers = date_time_get_now_simple_with_http_info(opts)
  data
end
date_time_get_now_simple_with_http_info(opts = {}) click to toggle source

Get current date and time as of now Gets the current date and time. Response time is syncronized with atomic clocks, and represents a monotonic, centrally available, consistent clock. @param [Hash] opts the optional parameters @return [Array<(DateTimeNowResult, Fixnum, Hash)>] DateTimeNowResult data, response status code and response headers

# File lib/cloudmersive-validate-api-client/api/date_time_api.rb, line 35
def date_time_get_now_simple_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DateTimeApi.date_time_get_now_simple ...'
  end
  # resource path
  local_var_path = '/validate/date-time/get/now'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DateTimeNowResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DateTimeApi#date_time_get_now_simple\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
date_time_get_public_holidays(input, opts = {}) click to toggle source

Get public holidays in the specified country and year Enumerates all public holidays in a given country for a given year. Supports over 100 countries. @param input Input request @param [Hash] opts the optional parameters @return [PublicHolidaysResponse]

# File lib/cloudmersive-validate-api-client/api/date_time_api.rb, line 73
def date_time_get_public_holidays(input, opts = {})
  data, _status_code, _headers = date_time_get_public_holidays_with_http_info(input, opts)
  data
end
date_time_get_public_holidays_with_http_info(input, opts = {}) click to toggle source

Get public holidays in the specified country and year Enumerates all public holidays in a given country for a given year. Supports over 100 countries. @param input Input request @param [Hash] opts the optional parameters @return [Array<(PublicHolidaysResponse, Fixnum, Hash)>] PublicHolidaysResponse data, response status code and response headers

# File lib/cloudmersive-validate-api-client/api/date_time_api.rb, line 83
def date_time_get_public_holidays_with_http_info(input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DateTimeApi.date_time_get_public_holidays ...'
  end
  # verify the required parameter 'input' is set
  if @api_client.config.client_side_validation && input.nil?
    fail ArgumentError, "Missing the required parameter 'input' when calling DateTimeApi.date_time_get_public_holidays"
  end
  # resource path
  local_var_path = '/validate/date-time/get/holidays'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(input)
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PublicHolidaysResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DateTimeApi#date_time_get_public_holidays\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
date_time_parse_natural_language_date_time(input, opts = {}) click to toggle source

Parses a free-form natural language date and time string into a date and time Parses an unstructured, free-form, natural language date and time string into a date time object. This is intended for lightweight human-entered input, such as "tomorrow at 3pm" or "tuesday". @param input Input request @param [Hash] opts the optional parameters @return [DateTimeStandardizedParseResponse]

# File lib/cloudmersive-validate-api-client/api/date_time_api.rb, line 127
def date_time_parse_natural_language_date_time(input, opts = {})
  data, _status_code, _headers = date_time_parse_natural_language_date_time_with_http_info(input, opts)
  data
end
date_time_parse_natural_language_date_time_with_http_info(input, opts = {}) click to toggle source

Parses a free-form natural language date and time string into a date and time Parses an unstructured, free-form, natural language date and time string into a date time object. This is intended for lightweight human-entered input, such as "tomorrow at 3pm&quot; or "tuesday&quot;. @param input Input request @param [Hash] opts the optional parameters @return [Array<(DateTimeStandardizedParseResponse, Fixnum, Hash)>] DateTimeStandardizedParseResponse data, response status code and response headers

# File lib/cloudmersive-validate-api-client/api/date_time_api.rb, line 137
def date_time_parse_natural_language_date_time_with_http_info(input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DateTimeApi.date_time_parse_natural_language_date_time ...'
  end
  # verify the required parameter 'input' is set
  if @api_client.config.client_side_validation && input.nil?
    fail ArgumentError, "Missing the required parameter 'input' when calling DateTimeApi.date_time_parse_natural_language_date_time"
  end
  # resource path
  local_var_path = '/validate/date-time/parse/date-time/natural-language'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(input)
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DateTimeStandardizedParseResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DateTimeApi#date_time_parse_natural_language_date_time\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
date_time_parse_standard_date_time(input, opts = {}) click to toggle source

Parses a standardized date and time string into a date and time Parses a structured date and time string into a date time object. This is intended for standardized date strings that adhere to formatting conventions, rather than natural language input. @param input Input request @param [Hash] opts the optional parameters @return [DateTimeStandardizedParseResponse]

# File lib/cloudmersive-validate-api-client/api/date_time_api.rb, line 181
def date_time_parse_standard_date_time(input, opts = {})
  data, _status_code, _headers = date_time_parse_standard_date_time_with_http_info(input, opts)
  data
end
date_time_parse_standard_date_time_with_http_info(input, opts = {}) click to toggle source

Parses a standardized date and time string into a date and time Parses a structured date and time string into a date time object. This is intended for standardized date strings that adhere to formatting conventions, rather than natural language input. @param input Input request @param [Hash] opts the optional parameters @return [Array<(DateTimeStandardizedParseResponse, Fixnum, Hash)>] DateTimeStandardizedParseResponse data, response status code and response headers

# File lib/cloudmersive-validate-api-client/api/date_time_api.rb, line 191
def date_time_parse_standard_date_time_with_http_info(input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DateTimeApi.date_time_parse_standard_date_time ...'
  end
  # verify the required parameter 'input' is set
  if @api_client.config.client_side_validation && input.nil?
    fail ArgumentError, "Missing the required parameter 'input' when calling DateTimeApi.date_time_parse_standard_date_time"
  end
  # resource path
  local_var_path = '/validate/date-time/parse/date-time/structured'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(input)
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DateTimeStandardizedParseResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DateTimeApi#date_time_parse_standard_date_time\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end