Class: AsposeEmailCloud::AiNameApi

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose-email-cloud/api/ai_name_api.rb

Overview

AiNameApi operations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_invoker) ⇒ AiNameApi

Initializes a new instance of the AiNameApi class.

Parameters:



45
46
47
# File 'lib/aspose-email-cloud/api/ai_name_api.rb', line 45

def initialize(api_invoker)
  @api_invoker = api_invoker
end

Instance Attribute Details

#api_invokerObject (readonly)

Returns the value of attribute api_invoker.



31
32
33
# File 'lib/aspose-email-cloud/api/ai_name_api.rb', line 31

def api_invoker
  @api_invoker
end

Instance Method Details

#complete(request) ⇒ AiNameWeightedVariants

The call proposes k most probable names for given starting characters.

Parameters:

Returns:



52
53
54
55
# File 'lib/aspose-email-cloud/api/ai_name_api.rb', line 52

def complete(request)
  http_request = request.to_http_info(@api_invoker.api_client)
  @api_invoker.make_request(http_request, :GET, 'AiNameWeightedVariants')
end

#expand(request) ⇒ AiNameWeightedVariants

Expands a person’s name into a list of possible alternatives using options for expanding instructions.

Parameters:

Returns:



60
61
62
63
# File 'lib/aspose-email-cloud/api/ai_name_api.rb', line 60

def expand(request)
  http_request = request.to_http_info(@api_invoker.api_client)
  @api_invoker.make_request(http_request, :GET, 'AiNameWeightedVariants')
end

#expand_parsed(request) ⇒ AiNameWeightedVariants

Expands a person’s parsed name into a list of possible alternatives using options for expanding instructions.

Parameters:

Returns:



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/aspose-email-cloud/api/ai_name_api.rb', line 68

def expand_parsed(request)
  # verify the required parameter 'request' is set
  if @api_invoker.api_client.config.client_side_validation && request.nil?
    raise ArgumentError, "Missing the required parameter 'request' when calling AiNameApi.expand_parsed"
  end

  local_var_path = '/email/AiName/expand-parsed'
  post_body = @api_invoker.api_client.object_to_http_body(request)
  auth_names = ['JWT']

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = EmailRequest.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = EmailRequest.select_header_content_type(['application/json'])
  http_request = AsposeEmailCloud::HttpRequest.new(resource_path: local_var_path,
                                                   header_params: header_params,
                                                   body: post_body,
                                                   auth_names: auth_names)

  @api_invoker.make_request(http_request, :PUT, 'AiNameWeightedVariants')
end

#format(request) ⇒ AiNameFormatted

Formats a person’s name in correct case and name order using options for formatting instructions.

Parameters:

Returns:



95
96
97
98
# File 'lib/aspose-email-cloud/api/ai_name_api.rb', line 95

def format(request)
  http_request = request.to_http_info(@api_invoker.api_client)
  @api_invoker.make_request(http_request, :GET, 'AiNameFormatted')
end

#format_parsed(request) ⇒ AiNameFormatted

Formats a person’s parsed name in correct case and name order using options for formatting instructions.

Parameters:

Returns:



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/aspose-email-cloud/api/ai_name_api.rb', line 103

def format_parsed(request)
  # verify the required parameter 'request' is set
  if @api_invoker.api_client.config.client_side_validation && request.nil?
    raise ArgumentError, "Missing the required parameter 'request' when calling AiNameApi.format_parsed"
  end

  local_var_path = '/email/AiName/format-parsed'
  post_body = @api_invoker.api_client.object_to_http_body(request)
  auth_names = ['JWT']

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = EmailRequest.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = EmailRequest.select_header_content_type(['application/json'])
  http_request = AsposeEmailCloud::HttpRequest.new(resource_path: local_var_path,
                                                   header_params: header_params,
                                                   body: post_body,
                                                   auth_names: auth_names)

  @api_invoker.make_request(http_request, :PUT, 'AiNameFormatted')
end

#genderize(request) ⇒ AiNameGenderHypothesisList

Detect person’s gender from name string.

Parameters:

Returns:



130
131
132
133
# File 'lib/aspose-email-cloud/api/ai_name_api.rb', line 130

def genderize(request)
  http_request = request.to_http_info(@api_invoker.api_client)
  @api_invoker.make_request(http_request, :GET, 'AiNameGenderHypothesisList')
end

#genderize_parsed(request) ⇒ AiNameGenderHypothesisList

Detect person’s gender from parsed name.

Parameters:

Returns:



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/aspose-email-cloud/api/ai_name_api.rb', line 138

def genderize_parsed(request)
  # verify the required parameter 'request' is set
  if @api_invoker.api_client.config.client_side_validation && request.nil?
    raise ArgumentError, "Missing the required parameter 'request' when calling AiNameApi.genderize_parsed"
  end

  local_var_path = '/email/AiName/genderize-parsed'
  post_body = @api_invoker.api_client.object_to_http_body(request)
  auth_names = ['JWT']

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = EmailRequest.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = EmailRequest.select_header_content_type(['application/json'])
  http_request = AsposeEmailCloud::HttpRequest.new(resource_path: local_var_path,
                                                   header_params: header_params,
                                                   body: post_body,
                                                   auth_names: auth_names)

  @api_invoker.make_request(http_request, :PUT, 'AiNameGenderHypothesisList')
end

#match(request) ⇒ AiNameMatchResult

Compare people’s names. Uses options for comparing instructions.

Parameters:

Returns:



165
166
167
168
# File 'lib/aspose-email-cloud/api/ai_name_api.rb', line 165

def match(request)
  http_request = request.to_http_info(@api_invoker.api_client)
  @api_invoker.make_request(http_request, :GET, 'AiNameMatchResult')
end

#match_parsed(request) ⇒ AiNameMatchResult

Compare people’s parsed names and attributes. Uses options for comparing instructions.

Parameters:

Returns:



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/aspose-email-cloud/api/ai_name_api.rb', line 173

def match_parsed(request)
  # verify the required parameter 'request' is set
  if @api_invoker.api_client.config.client_side_validation && request.nil?
    raise ArgumentError, "Missing the required parameter 'request' when calling AiNameApi.match_parsed"
  end

  local_var_path = '/email/AiName/match-parsed'
  post_body = @api_invoker.api_client.object_to_http_body(request)
  auth_names = ['JWT']

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = EmailRequest.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = EmailRequest.select_header_content_type(['application/json'])
  http_request = AsposeEmailCloud::HttpRequest.new(resource_path: local_var_path,
                                                   header_params: header_params,
                                                   body: post_body,
                                                   auth_names: auth_names)

  @api_invoker.make_request(http_request, :PUT, 'AiNameMatchResult')
end

#parse(request) ⇒ AiNameComponentList

Parse name to components.

Parameters:

Returns:



200
201
202
203
# File 'lib/aspose-email-cloud/api/ai_name_api.rb', line 200

def parse(request)
  http_request = request.to_http_info(@api_invoker.api_client)
  @api_invoker.make_request(http_request, :GET, 'AiNameComponentList')
end

#parse_email_address(request) ⇒ AiNameExtractedList

Parse person’s name out of an email address.

Parameters:

Returns:



208
209
210
211
# File 'lib/aspose-email-cloud/api/ai_name_api.rb', line 208

def parse_email_address(request)
  http_request = request.to_http_info(@api_invoker.api_client)
  @api_invoker.make_request(http_request, :GET, 'AiNameExtractedList')
end