public MetricDefinition withEventPattern(String eventPattern) {
        setEventPattern(eventPattern);
        return this;
    }
<p>
The EventBridge event pattern that defines how the metric is recorded.
</p>
<p>
For more information about EventBridge event patterns, see <a
href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html">Amazon EventBridge event
patterns</a>.
</p>
<p>
This field's value must be valid JSON according to RFC 7159, including the opening and closing braces. For
example: '{"key": "value"}'.
</p>
<p>
The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
Users of the SDK should not perform Base64 encoding on this field.
</p>

@param eventPattern
       The EventBridge event pattern that defines how the metric is recorded.</p>
       <p>
       For more information about EventBridge event patterns, see <a
       href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html">Amazon EventBridge
       event patterns</a>.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-cloudwatchevidently/src/main/java/com/amazonaws/services/cloudwatchevidently/model/MetricDefinition.java