class CloudmersiveValidateApiClient::NameApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

name_get_gender(input, opts = {}) click to toggle source

Get the gender of a first name Determines the gender of a first name (given name) @param input Gender request information @param [Hash] opts the optional parameters @return [GetGenderResponse]

# File lib/cloudmersive-validate-api-client/api/name_api.rb, line 27
def name_get_gender(input, opts = {})
  data, _status_code, _headers = name_get_gender_with_http_info(input, opts)
  data
end
name_get_gender_with_http_info(input, opts = {}) click to toggle source

Get the gender of a first name Determines the gender of a first name (given name) @param input Gender request information @param [Hash] opts the optional parameters @return [Array<(GetGenderResponse, Fixnum, Hash)>] GetGenderResponse data, response status code and response headers

# File lib/cloudmersive-validate-api-client/api/name_api.rb, line 37
def name_get_gender_with_http_info(input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NameApi.name_get_gender ...'
  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 NameApi.name_get_gender"
  end
  # resource path
  local_var_path = '/validate/name/get-gender'

  # 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 => 'GetGenderResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NameApi#name_get_gender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
name_identifier(input, opts = {}) click to toggle source

Validate a code identifier Determines if the input name is a valid technical / code identifier. Configure input rules such as whether whitespace, hyphens, underscores, etc. are allowed. For example, a valid identifier might be "helloWorld" but not "hello*World". @param input Identifier validation request information @param [Hash] opts the optional parameters @return [ValidateIdentifierResponse]

# File lib/cloudmersive-validate-api-client/api/name_api.rb, line 81
def name_identifier(input, opts = {})
  data, _status_code, _headers = name_identifier_with_http_info(input, opts)
  data
end
name_identifier_with_http_info(input, opts = {}) click to toggle source

Validate a code identifier Determines if the input name is a valid technical / code identifier. Configure input rules such as whether whitespace, hyphens, underscores, etc. are allowed. For example, a valid identifier might be "helloWorld&quot; but not "hello*World&quot;. @param input Identifier validation request information @param [Hash] opts the optional parameters @return [Array<(ValidateIdentifierResponse, Fixnum, Hash)>] ValidateIdentifierResponse data, response status code and response headers

# File lib/cloudmersive-validate-api-client/api/name_api.rb, line 91
def name_identifier_with_http_info(input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NameApi.name_identifier ...'
  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 NameApi.name_identifier"
  end
  # resource path
  local_var_path = '/validate/name/identifier'

  # 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 => 'ValidateIdentifierResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NameApi#name_identifier\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
name_validate_first_name(input, opts = {}) click to toggle source

Validate a first name Determines if a string is a valid first name (given name) @param input Validation request information @param [Hash] opts the optional parameters @return [FirstNameValidationResponse]

# File lib/cloudmersive-validate-api-client/api/name_api.rb, line 135
def name_validate_first_name(input, opts = {})
  data, _status_code, _headers = name_validate_first_name_with_http_info(input, opts)
  data
end
name_validate_first_name_with_http_info(input, opts = {}) click to toggle source

Validate a first name Determines if a string is a valid first name (given name) @param input Validation request information @param [Hash] opts the optional parameters @return [Array<(FirstNameValidationResponse, Fixnum, Hash)>] FirstNameValidationResponse data, response status code and response headers

# File lib/cloudmersive-validate-api-client/api/name_api.rb, line 145
def name_validate_first_name_with_http_info(input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NameApi.name_validate_first_name ...'
  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 NameApi.name_validate_first_name"
  end
  # resource path
  local_var_path = '/validate/name/first'

  # 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 => 'FirstNameValidationResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NameApi#name_validate_first_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
name_validate_full_name(input, opts = {}) click to toggle source

Parse and validate a full name Parses a full name string (e.g. "Mr. Jon van der Waal Jr.") into its component parts (and returns these component parts), and then validates whether it is a valid name string or not @param input Validation request information @param [Hash] opts the optional parameters @return [FullNameValidationResponse]

# File lib/cloudmersive-validate-api-client/api/name_api.rb, line 189
def name_validate_full_name(input, opts = {})
  data, _status_code, _headers = name_validate_full_name_with_http_info(input, opts)
  data
end
name_validate_full_name_with_http_info(input, opts = {}) click to toggle source

Parse and validate a full name Parses a full name string (e.g. "Mr. Jon van der Waal Jr.&quot;) into its component parts (and returns these component parts), and then validates whether it is a valid name string or not @param input Validation request information @param [Hash] opts the optional parameters @return [Array<(FullNameValidationResponse, Fixnum, Hash)>] FullNameValidationResponse data, response status code and response headers

# File lib/cloudmersive-validate-api-client/api/name_api.rb, line 199
def name_validate_full_name_with_http_info(input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NameApi.name_validate_full_name ...'
  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 NameApi.name_validate_full_name"
  end
  # resource path
  local_var_path = '/validate/name/full-name'

  # 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 => 'FullNameValidationResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NameApi#name_validate_full_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
name_validate_last_name(input, opts = {}) click to toggle source

Validate a last name Determines if a string is a valid last name (surname) @param input Validation request information @param [Hash] opts the optional parameters @return [LastNameValidationResponse]

# File lib/cloudmersive-validate-api-client/api/name_api.rb, line 243
def name_validate_last_name(input, opts = {})
  data, _status_code, _headers = name_validate_last_name_with_http_info(input, opts)
  data
end
name_validate_last_name_with_http_info(input, opts = {}) click to toggle source

Validate a last name Determines if a string is a valid last name (surname) @param input Validation request information @param [Hash] opts the optional parameters @return [Array<(LastNameValidationResponse, Fixnum, Hash)>] LastNameValidationResponse data, response status code and response headers

# File lib/cloudmersive-validate-api-client/api/name_api.rb, line 253
def name_validate_last_name_with_http_info(input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NameApi.name_validate_last_name ...'
  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 NameApi.name_validate_last_name"
  end
  # resource path
  local_var_path = '/validate/name/last'

  # 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 => 'LastNameValidationResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NameApi#name_validate_last_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end