// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.gcp.cloudfunctions.outputs;

import com.pulumi.core.annotations.CustomType;
import com.pulumi.gcp.cloudfunctions.outputs.GetFunctionEventTriggerFailurePolicy;
import java.lang.String;
import java.util.List;
import java.util.Objects;

@CustomType
public final class GetFunctionEventTrigger {
    /**
     * @return The type of event to observe. For example: `&#34;google.storage.object.finalize&#34;`.
     * See the documentation on [calling Cloud Functions](https://cloud.google.com/functions/docs/calling/)
     * for a full reference of accepted triggers.
     * 
     */
    private String eventType;
    /**
     * @return Policy for failed executions. Structure is documented below.
     * 
     */
    private List<GetFunctionEventTriggerFailurePolicy> failurePolicies;
    /**
     * @return The name of the resource whose events are being observed, for example, `&#34;myBucket&#34;`
     * 
     */
    private String resource;

    private GetFunctionEventTrigger() {}
    /**
     * @return The type of event to observe. For example: `&#34;google.storage.object.finalize&#34;`.
     * See the documentation on [calling Cloud Functions](https://cloud.google.com/functions/docs/calling/)
     * for a full reference of accepted triggers.
     * 
     */
    public String eventType() {
        return this.eventType;
    }
    /**
     * @return Policy for failed executions. Structure is documented below.
     * 
     */
    public List<GetFunctionEventTriggerFailurePolicy> failurePolicies() {
        return this.failurePolicies;
    }
    /**
     * @return The name of the resource whose events are being observed, for example, `&#34;myBucket&#34;`
     * 
     */
    public String resource() {
        return this.resource;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static Builder builder(GetFunctionEventTrigger defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private String eventType;
        private List<GetFunctionEventTriggerFailurePolicy> failurePolicies;
        private String resource;
        public Builder() {}
        public Builder(GetFunctionEventTrigger defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.eventType = defaults.eventType;
    	      this.failurePolicies = defaults.failurePolicies;
    	      this.resource = defaults.resource;
        }

        @CustomType.Setter
        public Builder eventType(String eventType) {
            this.eventType = Objects.requireNonNull(eventType);
            return this;
        }
        @CustomType.Setter
        public Builder failurePolicies(List<GetFunctionEventTriggerFailurePolicy> failurePolicies) {
            this.failurePolicies = Objects.requireNonNull(failurePolicies);
            return this;
        }
        public Builder failurePolicies(GetFunctionEventTriggerFailurePolicy... failurePolicies) {
            return failurePolicies(List.of(failurePolicies));
        }
        @CustomType.Setter
        public Builder resource(String resource) {
            this.resource = Objects.requireNonNull(resource);
            return this;
        }
        public GetFunctionEventTrigger build() {
            final var o = new GetFunctionEventTrigger();
            o.eventType = eventType;
            o.failurePolicies = failurePolicies;
            o.resource = resource;
            return o;
        }
    }
}
