aws_sdk_opensearch/operation/upgrade_domain/_upgrade_domain_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Container for the request parameters to the <code>UpgradeDomain</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpgradeDomainInput {
7 /// <p>Name of the OpenSearch Service domain that you want to upgrade.</p>
8 pub domain_name: ::std::option::Option<::std::string::String>,
9 /// <p>OpenSearch or Elasticsearch version to which you want to upgrade, in the format Opensearch_X.Y or Elasticsearch_X.Y.</p>
10 pub target_version: ::std::option::Option<::std::string::String>,
11 /// <p>When true, indicates that an upgrade eligibility check needs to be performed. Does not actually perform the upgrade.</p>
12 pub perform_check_only: ::std::option::Option<bool>,
13 /// <p>Only supports the <code>override_main_response_version</code> parameter and not other advanced options. You can only include this option when upgrading to an OpenSearch version. Specifies whether the domain reports its version as 7.10 so that it continues to work with Elasticsearch OSS clients and plugins.</p>
14 pub advanced_options: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
15}
16impl UpgradeDomainInput {
17 /// <p>Name of the OpenSearch Service domain that you want to upgrade.</p>
18 pub fn domain_name(&self) -> ::std::option::Option<&str> {
19 self.domain_name.as_deref()
20 }
21 /// <p>OpenSearch or Elasticsearch version to which you want to upgrade, in the format Opensearch_X.Y or Elasticsearch_X.Y.</p>
22 pub fn target_version(&self) -> ::std::option::Option<&str> {
23 self.target_version.as_deref()
24 }
25 /// <p>When true, indicates that an upgrade eligibility check needs to be performed. Does not actually perform the upgrade.</p>
26 pub fn perform_check_only(&self) -> ::std::option::Option<bool> {
27 self.perform_check_only
28 }
29 /// <p>Only supports the <code>override_main_response_version</code> parameter and not other advanced options. You can only include this option when upgrading to an OpenSearch version. Specifies whether the domain reports its version as 7.10 so that it continues to work with Elasticsearch OSS clients and plugins.</p>
30 pub fn advanced_options(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
31 self.advanced_options.as_ref()
32 }
33}
34impl UpgradeDomainInput {
35 /// Creates a new builder-style object to manufacture [`UpgradeDomainInput`](crate::operation::upgrade_domain::UpgradeDomainInput).
36 pub fn builder() -> crate::operation::upgrade_domain::builders::UpgradeDomainInputBuilder {
37 crate::operation::upgrade_domain::builders::UpgradeDomainInputBuilder::default()
38 }
39}
40
41/// A builder for [`UpgradeDomainInput`](crate::operation::upgrade_domain::UpgradeDomainInput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct UpgradeDomainInputBuilder {
45 pub(crate) domain_name: ::std::option::Option<::std::string::String>,
46 pub(crate) target_version: ::std::option::Option<::std::string::String>,
47 pub(crate) perform_check_only: ::std::option::Option<bool>,
48 pub(crate) advanced_options: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
49}
50impl UpgradeDomainInputBuilder {
51 /// <p>Name of the OpenSearch Service domain that you want to upgrade.</p>
52 /// This field is required.
53 pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54 self.domain_name = ::std::option::Option::Some(input.into());
55 self
56 }
57 /// <p>Name of the OpenSearch Service domain that you want to upgrade.</p>
58 pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59 self.domain_name = input;
60 self
61 }
62 /// <p>Name of the OpenSearch Service domain that you want to upgrade.</p>
63 pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
64 &self.domain_name
65 }
66 /// <p>OpenSearch or Elasticsearch version to which you want to upgrade, in the format Opensearch_X.Y or Elasticsearch_X.Y.</p>
67 /// This field is required.
68 pub fn target_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69 self.target_version = ::std::option::Option::Some(input.into());
70 self
71 }
72 /// <p>OpenSearch or Elasticsearch version to which you want to upgrade, in the format Opensearch_X.Y or Elasticsearch_X.Y.</p>
73 pub fn set_target_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74 self.target_version = input;
75 self
76 }
77 /// <p>OpenSearch or Elasticsearch version to which you want to upgrade, in the format Opensearch_X.Y or Elasticsearch_X.Y.</p>
78 pub fn get_target_version(&self) -> &::std::option::Option<::std::string::String> {
79 &self.target_version
80 }
81 /// <p>When true, indicates that an upgrade eligibility check needs to be performed. Does not actually perform the upgrade.</p>
82 pub fn perform_check_only(mut self, input: bool) -> Self {
83 self.perform_check_only = ::std::option::Option::Some(input);
84 self
85 }
86 /// <p>When true, indicates that an upgrade eligibility check needs to be performed. Does not actually perform the upgrade.</p>
87 pub fn set_perform_check_only(mut self, input: ::std::option::Option<bool>) -> Self {
88 self.perform_check_only = input;
89 self
90 }
91 /// <p>When true, indicates that an upgrade eligibility check needs to be performed. Does not actually perform the upgrade.</p>
92 pub fn get_perform_check_only(&self) -> &::std::option::Option<bool> {
93 &self.perform_check_only
94 }
95 /// Adds a key-value pair to `advanced_options`.
96 ///
97 /// To override the contents of this collection use [`set_advanced_options`](Self::set_advanced_options).
98 ///
99 /// <p>Only supports the <code>override_main_response_version</code> parameter and not other advanced options. You can only include this option when upgrading to an OpenSearch version. Specifies whether the domain reports its version as 7.10 so that it continues to work with Elasticsearch OSS clients and plugins.</p>
100 pub fn advanced_options(
101 mut self,
102 k: impl ::std::convert::Into<::std::string::String>,
103 v: impl ::std::convert::Into<::std::string::String>,
104 ) -> Self {
105 let mut hash_map = self.advanced_options.unwrap_or_default();
106 hash_map.insert(k.into(), v.into());
107 self.advanced_options = ::std::option::Option::Some(hash_map);
108 self
109 }
110 /// <p>Only supports the <code>override_main_response_version</code> parameter and not other advanced options. You can only include this option when upgrading to an OpenSearch version. Specifies whether the domain reports its version as 7.10 so that it continues to work with Elasticsearch OSS clients and plugins.</p>
111 pub fn set_advanced_options(
112 mut self,
113 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
114 ) -> Self {
115 self.advanced_options = input;
116 self
117 }
118 /// <p>Only supports the <code>override_main_response_version</code> parameter and not other advanced options. You can only include this option when upgrading to an OpenSearch version. Specifies whether the domain reports its version as 7.10 so that it continues to work with Elasticsearch OSS clients and plugins.</p>
119 pub fn get_advanced_options(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
120 &self.advanced_options
121 }
122 /// Consumes the builder and constructs a [`UpgradeDomainInput`](crate::operation::upgrade_domain::UpgradeDomainInput).
123 pub fn build(
124 self,
125 ) -> ::std::result::Result<crate::operation::upgrade_domain::UpgradeDomainInput, ::aws_smithy_types::error::operation::BuildError> {
126 ::std::result::Result::Ok(crate::operation::upgrade_domain::UpgradeDomainInput {
127 domain_name: self.domain_name,
128 target_version: self.target_version,
129 perform_check_only: self.perform_check_only,
130 advanced_options: self.advanced_options,
131 })
132 }
133}