Class: AsposeEmailCloud::AiNameFormatRequest

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

Overview

Request model for ai_name_format 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, format: nil, style: nil) ⇒ AiNameFormatRequest

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

Parameters:

  • name (String)

    A name to format.

  • 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.

  • format (String) (defaults to: nil)

    Format of the name. Predefined format can be used by ID, or custom format can be specified. Predefined formats: /format/default/ (= '%t%F%m%N%L%p') /format/FN+LN/ (= '%F%L') /format/title+FN+LN/ (= '%t%F%L') /format/FN+MN+LN/ (= '%F%M%N%L') /format/title+FN+MN+LN/ (= '%t%F%M%N%L') /format/FN+MI+LN/ (= '%F%m%N%L') /format/title+FN+MI+LN/ (= '%t%F%m%N%L') /format/LN/ (= '%L') /format/title+LN/ (= '%t%L') /format/LN+FN+MN/ (= '%L,%F%M%N') /format/LN+title+FN+MN/ (= '%L,%t%F%M%N') /format/LN+FN+MI/ (= '%L,%F%m%N') /format/LN+title+FN+MI/ (= '%L,%t%F%m%N') Custom format string - custom combination of characters and the next term placeholders: '%t' - Title (prefix) '%F' - First name '%f' - First initial '%M' - Middle name(s) '%m' - Middle initial(s) '%N' - Nickname '%L' - Last name '%l' - Last initial '%p' - Postfix If no value for format option was provided, its default value is '%t%F%m%N%L%p'

  • style (String) (defaults to: nil)

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



62
63
64
65
66
67
68
69
70
# File 'lib/aspose-email-cloud/models/ai_name_format_request.rb', line 62

def initialize(name:, language: nil, location: nil, encoding: nil, script: nil, format: 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.format = format if format
  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_format_request.rb', line 43

def encoding
  @encoding
end

#formatString

Format of the name. Predefined format can be used by ID, or custom format can be specified. Predefined formats: /format/default/ (= '%t%F%m%N%L%p') /format/FN+LN/ (= '%F%L') /format/title+FN+LN/ (= '%t%F%L') /format/FN+MN+LN/ (= '%F%M%N%L') /format/title+FN+MN+LN/ (= '%t%F%M%N%L') /format/FN+MI+LN/ (= '%F%m%N%L') /format/title+FN+MI+LN/ (= '%t%F%m%N%L') /format/LN/ (= '%L') /format/title+LN/ (= '%t%L') /format/LN+FN+MN/ (= '%L,%F%M%N') /format/LN+title+FN+MN/ (= '%L,%t%F%M%N') /format/LN+FN+MI/ (= '%L,%F%m%N') /format/LN+title+FN+MI/ (= '%L,%t%F%m%N') Custom format string - custom combination of characters and the next term placeholders: '%t' - Title (prefix) '%F' - First name '%f' - First initial '%M' - Middle name(s) '%m' - Middle initial(s) '%N' - Nickname '%L' - Last name '%l' - Last initial '%p' - Postfix If no value for format option was provided, its default value is '%t%F%m%N%L%p'

Returns:

  • (String)


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

def format
  @format
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_format_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_format_request.rb', line 40

def location
  @location
end

#nameString

A name to format.

Returns:

  • (String)


34
35
36
# File 'lib/aspose-email-cloud/models/ai_name_format_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_format_request.rb', line 46

def script
  @script
end

#styleString

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

Returns:

  • (String)


52
53
54
# File 'lib/aspose-email-cloud/models/ai_name_format_request.rb', line 52

def style
  @style
end

Instance Method Details

#to_http_info(api_client) ⇒ Object



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
103
104
105
106
107
108
# File 'lib/aspose-email-cloud/models/ai_name_format_request.rb', line 72

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.format"
  end
  # resource path
  local_var_path = '/email/AiName/format'

  # 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[:format] = self.format unless self.format.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