Skip to content

Commit

Permalink
# Removed duplicated types
Browse files Browse the repository at this point in the history
Signed-off-by: Theo Truong <[email protected]>
# Sorted types
# User Enumerable instead of Array
  • Loading branch information
nhtruong committed Dec 11, 2024
1 parent c06bb81 commit 8536632
Show file tree
Hide file tree
Showing 120 changed files with 303 additions and 303 deletions.
4 changes: 2 additions & 2 deletions api_generator/lib/components/argument.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ def initialize(name:, description:, required:, schema:, default:, deprecated:, d
def get_ruby_type(schema)
return nil if schema.nil?
union = schema.anyOf || schema.oneOf
return union.map { |sch| get_ruby_type(sch) }.join(', ') unless union.nil?
return union.map { |sch| get_ruby_type(sch) }.uniq.sort.join(', ') unless union.nil?
return 'Integer' if schema.type == 'integer'
return 'Float' if schema.type == 'number'
return 'Boolean' if schema.type == 'boolean'
return 'String' if schema.type == 'string'
return 'NilClass' if schema.type == 'null'
return "Array<#{get_ruby_type(schema.items)}>" if schema.type == 'array'
return "Enumerable<#{get_ruby_type(schema.items)}>" if schema.type == 'array'
"Hash"
end

Expand Down
10 changes: 5 additions & 5 deletions lib/opensearch/api/actions/bulk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ module Root
module Actions
# Allows to perform multiple index/update/delete operations in a single request.
#
# @option args [Boolean, String, Array<String>] :_source `true` or `false` to return the `_source` field or not, or a list of fields to return.
# @option args [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude from the response.
# @option args [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.
# @option args [Boolean, Enumerable<String>, String] :_source `true` or `false` to return the `_source` field or not, or a list of fields to return.
# @option args [Enumerable<String>, String] :_source_excludes A comma-separated list of source fields to exclude from the response.
# @option args [Enumerable<String>, String] :_source_includes A comma-separated list of source fields to include in the response.
# @option args [String] :pipeline ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter.
# @option args [Boolean, String] :refresh If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`.
# @option args [Boolean] :require_alias If `true`, the request's actions must target an index alias.
# @option args [String, Array<String>] :routing Custom value used to route operations to a specific shard.
# @option args [Enumerable<String>, String] :routing Custom value used to route operations to a specific shard.
# @option args [String] :timeout Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.
# @option args [String] :type Default document type for items which don't provide one.
# @option args [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).
# @option args [String] :index Name of the data stream, index, or index alias to perform bulk actions on.
# @option args [Array<Hash, Hash, Hash>] :body *Required* The operation definition and data (action-data pairs), separated by newlines
# @option args [Enumerable<Hash>] :body *Required* The operation definition and data (action-data pairs), separated by newlines
def bulk(args = {})
args = Utils.normalize_arguments(args)
raise ArgumentError, "Required argument 'body' missing" unless args['body']
Expand Down
10 changes: 5 additions & 5 deletions lib/opensearch/api/actions/bulk_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ module Root
module Actions
# Allows to perform multiple index/update/delete operations using request response streaming.
#
# @option args [Boolean, String, Array<String>] :_source `true` or `false` to return the `_source` field or not, or a list of fields to return.
# @option args [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude from the response.
# @option args [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.
# @option args [Boolean, Enumerable<String>, String] :_source `true` or `false` to return the `_source` field or not, or a list of fields to return.
# @option args [Enumerable<String>, String] :_source_excludes A comma-separated list of source fields to exclude from the response.
# @option args [Enumerable<String>, String] :_source_includes A comma-separated list of source fields to include in the response.
# @option args [String] :batch_interval Specifies for how long bulk operations should be accumulated into a batch before sending the batch to data nodes.
# @option args [Integer] :batch_size Specifies how many bulk operations should be accumulated into a batch before sending the batch to data nodes.
# @option args [String] :pipeline ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter.
# @option args [Boolean, String] :refresh If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`.
# @option args [Boolean] :require_alias If `true`, the request's actions must target an index alias.
# @option args [String, Array<String>] :routing Custom value used to route operations to a specific shard.
# @option args [Enumerable<String>, String] :routing Custom value used to route operations to a specific shard.
# @option args [String] :timeout Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.
# @option args [String] :type Default document type for items which don't provide one.
# @option args [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).
# @option args [String] :index Name of the data stream, index, or index alias to perform bulk actions on.
# @option args [Array<Hash, Hash, Hash>] :body *Required* The operation definition and data (action-data pairs), separated by newlines
# @option args [Enumerable<Hash>] :body *Required* The operation definition and data (action-data pairs), separated by newlines
def bulk_stream(args = {})
args = Utils.normalize_arguments(args)
raise ArgumentError, "Required argument 'body' missing" unless args['body']
Expand Down
8 changes: 4 additions & 4 deletions lib/opensearch/api/actions/cat/aliases.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ module Cat
module Actions
# Shows information about currently configured aliases to indexes including filter and routing info.
#
# @option args [String, String, String, String, String, Array<String, String, String, String, String>] :expand_wildcards Whether to expand wildcard expression to concrete indexes that are open, closed or both.
# @option args [Enumerable<String>, String] :expand_wildcards Whether to expand wildcard expression to concrete indexes that are open, closed or both.
# @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`).
# @option args [Array<String>] :h Comma-separated list of column names to display.
# @option args [Enumerable<String>] :h Comma-separated list of column names to display.
# @option args [Boolean] :help Return help information.
# @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node.
# @option args [Array<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [Enumerable<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [Boolean] :v Verbose mode. Display column headers.
# @option args [String, Array<String>] :name A comma-separated list of aliases to retrieve. Supports wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`.
# @option args [Enumerable<String>, String] :name A comma-separated list of aliases to retrieve. Supports wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`.
def aliases(args = {})
args = Utils.normalize_arguments(args)
_name = args.delete('name')
Expand Down
4 changes: 2 additions & 2 deletions lib/opensearch/api/actions/cat/all_pit_segments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ module Actions
#
# @option args [String] :bytes The unit in which to display byte values.
# @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`).
# @option args [Array<String>] :h Comma-separated list of column names to display.
# @option args [Enumerable<String>] :h Comma-separated list of column names to display.
# @option args [Boolean] :help Return help information.
# @option args [Array<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [Enumerable<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [Boolean] :v Verbose mode. Display column headers.
def all_pit_segments(args = {})
args = Utils.normalize_arguments(args)
Expand Down
6 changes: 3 additions & 3 deletions lib/opensearch/api/actions/cat/allocation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ module Actions
# @option args [String] :bytes The unit used to display byte values.
# @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node.
# @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`).
# @option args [Array<String>] :h Comma-separated list of column names to display.
# @option args [Enumerable<String>] :h Comma-separated list of column names to display.
# @option args [Boolean] :help Return help information.
# @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node.
# @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node.
# @option args [Array<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [Enumerable<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [Boolean] :v Verbose mode. Display column headers.
# @option args [String, Array<String>] :node_id Comma-separated list of node identifiers or names used to limit the returned information.
# @option args [Enumerable<String>, String] :node_id Comma-separated list of node identifiers or names used to limit the returned information.
def allocation(args = {})
args = Utils.normalize_arguments(args)
_node_id = args.delete('node_id')
Expand Down
4 changes: 2 additions & 2 deletions lib/opensearch/api/actions/cat/cluster_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ module Actions
#
# @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node.
# @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`).
# @option args [Array<String>] :h Comma-separated list of column names to display.
# @option args [Enumerable<String>] :h Comma-separated list of column names to display.
# @option args [Boolean] :help Return help information.
# @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node.
# @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node.
# @option args [Array<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [Enumerable<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [Boolean] :v Verbose mode. Display column headers.
def cluster_manager(args = {})
args = Utils.normalize_arguments(args)
Expand Down
6 changes: 3 additions & 3 deletions lib/opensearch/api/actions/cat/count.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ module Actions
# Provides quick access to the document count of the entire cluster, or individual indexes.
#
# @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`).
# @option args [Array<String>] :h Comma-separated list of column names to display.
# @option args [Enumerable<String>] :h Comma-separated list of column names to display.
# @option args [Boolean] :help Return help information.
# @option args [Array<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [Enumerable<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [Boolean] :v Verbose mode. Display column headers.
# @option args [String, Array<String>] :index Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`.
# @option args [Enumerable<String>, String] :index Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`.
def count(args = {})
args = Utils.normalize_arguments(args)
_index = args.delete('index')
Expand Down
6 changes: 3 additions & 3 deletions lib/opensearch/api/actions/cat/fielddata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ module Actions
# Shows how much heap memory is currently being used by field data on every data node in the cluster.
#
# @option args [String] :bytes The unit used to display byte values.
# @option args [String, Array<String>] :fields Comma-separated list of fields used to limit returned information.
# @option args [Enumerable<String>, String] :fields Comma-separated list of fields used to limit returned information.
# @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`).
# @option args [Array<String>] :h Comma-separated list of column names to display.
# @option args [Enumerable<String>] :h Comma-separated list of column names to display.
# @option args [Boolean] :help Return help information.
# @option args [Array<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [Enumerable<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [Boolean] :v Verbose mode. Display column headers.
def fielddata(args = {})
args = Utils.normalize_arguments(args)
Expand Down
4 changes: 2 additions & 2 deletions lib/opensearch/api/actions/cat/health.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ module Actions
# Returns a concise representation of the cluster health.
#
# @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`).
# @option args [Array<String>] :h Comma-separated list of column names to display.
# @option args [Enumerable<String>] :h Comma-separated list of column names to display.
# @option args [Boolean] :help Return help information.
# @option args [Array<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [Enumerable<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [String] :time The unit used to display time values.
# @option args [Boolean] :ts If `true`, returns `HH:MM:SS` and Unix epoch timestamps.
# @option args [Boolean] :v Verbose mode. Display column headers.
Expand Down
8 changes: 4 additions & 4 deletions lib/opensearch/api/actions/cat/indices.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ module Actions
#
# @option args [String] :bytes The unit used to display byte values.
# @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node.
# @option args [String, String, String, String, String, Array<String, String, String, String, String>] :expand_wildcards The type of index that wildcard patterns can match.
# @option args [Enumerable<String>, String] :expand_wildcards The type of index that wildcard patterns can match.
# @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`).
# @option args [Array<String>] :h Comma-separated list of column names to display.
# @option args [Enumerable<String>] :h Comma-separated list of column names to display.
# @option args [String] :health The health status used to limit returned indexes. By default, the response includes indexes of any health status.
# @option args [Boolean] :help Return help information.
# @option args [Boolean] :include_unloaded_segments If `true`, the response includes information from segments that are not loaded into memory.
# @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node.
# @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node.
# @option args [Boolean] :pri If `true`, the response only includes information from primary shards.
# @option args [Array<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [Enumerable<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [String] :time The unit used to display time values.
# @option args [Boolean] :v Verbose mode. Display column headers.
# @option args [String, Array<String>] :index Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`.
# @option args [Enumerable<String>, String] :index Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`.
def indices(args = {})
args = Utils.normalize_arguments(args)
_index = args.delete('index')
Expand Down
4 changes: 2 additions & 2 deletions lib/opensearch/api/actions/cat/master.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ module Actions
#
# @option args [String] :cluster_manager_timeout Operation timeout for connection to cluster-manager node.
# @option args [String] :format A short version of the Accept header (for example, `json`, `yaml`).
# @option args [Array<String>] :h Comma-separated list of column names to display.
# @option args [Enumerable<String>] :h Comma-separated list of column names to display.
# @option args [Boolean] :help Return help information.
# @option args [Boolean] :local Return local information, do not retrieve the state from cluster-manager node.
# @option args [String] :master_timeout DEPRECATED Operation timeout for connection to cluster-manager node.
# @option args [Array<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [Enumerable<String>] :s Comma-separated list of column names or column aliases to sort by.
# @option args [Boolean] :v Verbose mode. Display column headers.
def master(args = {})
args = Utils.normalize_arguments(args)
Expand Down
Loading

0 comments on commit 8536632

Please sign in to comment.