public LambdaFunctionAssociation withEventType(EventType eventType) {
        this.eventType = eventType.toString();
        return this;
    }
<p>
Specifies the event type that triggers a Lambda@Edge function invocation. You can specify the following values:
</p>
<ul>
<li>
<p>
<code>viewer-request</code>: The function executes when CloudFront receives a request from a viewer and before it
checks to see whether the requested object is in the edge cache.
</p>
</li>
<li>
<p>
<code>origin-request</code>: The function executes only when CloudFront sends a request to your origin. When the
requested object is in the edge cache, the function doesn't execute.
</p>
</li>
<li>
<p>
<code>origin-response</code>: The function executes after CloudFront receives a response from the origin and
before it caches the object in the response. When the requested object is in the edge cache, the function doesn't
execute.
</p>
</li>
<li>
<p>
<code>viewer-response</code>: The function executes before CloudFront returns the requested object to the viewer.
The function executes regardless of whether the object was already in the edge cache.
</p>
<p>
If the origin returns an HTTP status code other than HTTP 200 (OK), the function doesn't execute.
</p>
</li>
</ul>

@param eventType
       Specifies the event type that triggers a Lambda@Edge function invocation. You can specify the following
       values:</p>
       <ul>
       <li>
       <p>
       <code>viewer-request</code>: The function executes when CloudFront receives a request from a viewer and
       before it checks to see whether the requested object is in the edge cache.
       </p>
       </li>
       <li>
       <p>
       <code>origin-request</code>: The function executes only when CloudFront sends a request to your origin.
       When the requested object is in the edge cache, the function doesn't execute.
       </p>
       </li>
       <li>
       <p>
       <code>origin-response</code>: The function executes after CloudFront receives a response from the origin
       and before it caches the object in the response. When the requested object is in the edge cache, the
       function doesn't execute.
       </p>
       </li>
       <li>
       <p>
       <code>viewer-response</code>: The function executes before CloudFront returns the requested object to the
       viewer. The function executes regardless of whether the object was already in the edge cache.
       </p>
       <p>
       If the origin returns an HTTP status code other than HTTP 200 (OK), the function doesn't execute.
       </p>
       </li>
@return Returns a reference to this object so that method calls can be chained together.
@see EventType
aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/model/LambdaFunctionAssociation.java