public UpgradeDomainRequest withTargetVersion(String targetVersion) {
        setTargetVersion(targetVersion);
        return this;
    }
<p>
OpenSearch or Elasticsearch version to which you want to upgrade, in the format Opensearch_X.Y or
Elasticsearch_X.Y.
</p>

@param targetVersion
       OpenSearch or Elasticsearch version to which you want to upgrade, in the format Opensearch_X.Y or
       Elasticsearch_X.Y.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-opensearch/src/main/java/com/amazonaws/services/opensearch/model/UpgradeDomainRequest.java