Class: AsposeEmailCloud::AiNameCompleteRequest

Inherits:
EmailRequest
  • Object
show all
Defined in:
lib/aspose-email-cloud/models/ai_name_complete_request.rb

Overview

Request model for ai_name_complete operation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from EmailRequest

select_header_accept, select_header_content_type

Constructor Details

#initialize(name:, language: nil, location: nil, encoding: nil, script: nil, style: nil) ⇒ AiNameCompleteRequest

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

Parameters:

  • name (String)

    A name to complete.

  • language (String) (defaults to: nil)

    An ISO-639 code of the language; either 639-1 or 639-3 (e.g. "it" or "ita" for Italian).

  • location (String) (defaults to: nil)

    A geographic code such as an ISO-3166 two letter country code, for example "FR" for France.

  • encoding (String) (defaults to: nil)

    A character encoding name.

  • script (String) (defaults to: nil)

    A writing system code; starts with the ISO-15924 script name.

  • style (String) (defaults to: nil)

    Name writing style. Enum, available values: Formal, Informal, Legal, Academic



58
59
60
61
62
63
64
65
# File 'lib/aspose-email-cloud/models/ai_name_complete_request.rb', line 58

def initialize(name:, language: nil, location: nil, encoding: nil, script: nil, style: nil)
  self.name = name if name
  self.language = language if language
  self.location = location if location
  self.encoding = encoding if encoding
  self.script = script if script
  self.style = style if style
end

Instance Attribute Details

#encodingString

A character encoding name.

Returns:

  • (String)


43
44
45
# File 'lib/aspose-email-cloud/models/ai_name_complete_request.rb', line 43

def encoding
  @encoding
end

#languageString

An ISO-639 code of the language; either 639-1 or 639-3 (e.g. "it" or "ita" for Italian).

Returns:

  • (String)


37
38
39
# File 'lib/aspose-email-cloud/models/ai_name_complete_request.rb', line 37

def language
  @language
end

#locationString

A geographic code such as an ISO-3166 two letter country code, for example "FR" for France.

Returns:

  • (String)


40
41
42
# File 'lib/aspose-email-cloud/models/ai_name_complete_request.rb', line 40

def location
  @location
end

#nameString

A name to complete.

Returns:

  • (String)


34
35
36
# File 'lib/aspose-email-cloud/models/ai_name_complete_request.rb', line 34

def name
  @name
end

#scriptString

A writing system code; starts with the ISO-15924 script name.

Returns:

  • (String)


46
47
48
# File 'lib/aspose-email-cloud/models/ai_name_complete_request.rb', line 46

def script
  @script
end

#styleString

Name writing style. Enum, available values: Formal, Informal, Legal, Academic

Returns:

  • (String)


49
50
51
# File 'lib/aspose-email-cloud/models/ai_name_complete_request.rb', line 49

def style
  @style
end

Instance Method Details

#to_http_info(api_client) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/aspose-email-cloud/models/ai_name_complete_request.rb', line 67

def to_http_info(api_client)
  # verify the required parameter 'name' is set
  if api_client.config.client_side_validation && self.name.nil?
    raise ArgumentError, "Missing the required parameter 'name' when calling AiNameApi.complete"
  end
  # resource path
  local_var_path = '/email/AiName/complete'

  # query parameters
  query_params = {}
  query_params[:name] = self.name
  query_params[:language] = self.language unless self.language.nil?
  query_params[:location] = self.location unless self.location.nil?
  query_params[:encoding] = self.encoding unless self.encoding.nil?
  query_params[:script] = self.script unless self.script.nil?
  query_params[:style] = self.style unless self.style.nil?

  # form parameters
  form_params = {}

  # http body (model)
  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'] = form_params.any? ? 'multipart/form-data' : EmailRequest.select_header_content_type(['application/json'])

  AsposeEmailCloud::HttpRequest.new(resource_path: local_var_path,
                                    header_params: header_params,
                                    query_params: query_params,
                                    form_params: form_params,
                                    auth_names: auth_names)
end