@Override
    public PutMetricStreamResult putMetricStream(PutMetricStreamRequest request) {
        request = beforeClientExecution(request);
        return executePutMetricStream(request);
    }
<p>
Creates or updates a metric stream. Metric streams can automatically stream CloudWatch metrics to Amazon Web
Services destinations, including Amazon S3, and to many third-party solutions.
</p>
<p>
For more information, see <a
href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Metric-Streams.html"> Using
Metric Streams</a>.
</p>
<p>
To create a metric stream, you must be signed in to an account that has the <code>iam:PassRole</code> permission
and either the <code>CloudWatchFullAccess</code> policy or the <code>cloudwatch:PutMetricStream</code>
permission.
</p>
<p>
When you create or update a metric stream, you choose one of the following:
</p>
<ul>
<li>
<p>
Stream metrics from all metric namespaces in the account.
</p>
</li>
<li>
<p>
Stream metrics from all metric namespaces in the account, except for the namespaces that you list in
<code>ExcludeFilters</code>.
</p>
</li>
<li>
<p>
Stream metrics from only the metric namespaces that you list in <code>IncludeFilters</code>.
</p>
</li>
</ul>
<p>
By default, a metric stream always sends the <code>MAX</code>, <code>MIN</code>, <code>SUM</code>, and
<code>SAMPLECOUNT</code> statistics for each metric that is streamed. You can use the
<code>StatisticsConfigurations</code> parameter to have the metric stream send additional statistics in the
stream. Streaming additional statistics incurs additional costs. For more information, see <a
href="https://aws.amazon.com/cloudwatch/pricing/">Amazon CloudWatch Pricing</a>.
</p>
<p>
When you use <code>PutMetricStream</code> to create a new metric stream, the stream is created in the
<code>running</code> state. If you use it to update an existing stream, the state of the stream is not changed.
</p>
<p>
If you are using CloudWatch cross-account observability and you create a metric stream in a monitoring account,
you can choose whether to include metrics from source accounts in the stream. For more information, see <a
href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html"
>CloudWatch cross-account observability</a>.
</p>

@param putMetricStreamRequest
@return Result of the PutMetricStream operation returned by the service.
@throws ConcurrentModificationException
        More than one process tried to modify a resource at the same time.
@throws InternalServiceException
        Request processing has failed due to some unknown error, exception, or failure.
@throws InvalidParameterValueException
        The value of an input parameter is bad or out-of-range.
@throws MissingRequiredParameterException
        An input parameter that is required is missing.
@throws InvalidParameterCombinationException
        Parameters were used together that cannot be used together.
@sample AmazonCloudWatch.PutMetricStream
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricStream" target="_top">AWS API
     Documentation</a>
aws-java-sdk-cloudwatch/src/main/java/com/amazonaws/services/cloudwatch/AmazonCloudWatchClient.java