All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.kestra.plugin.gcp.AbstractTask Maven / Gradle / Ivy

There is a newer version: 0.21.2
Show newest version
package io.kestra.plugin.gcp;

import com.google.auth.oauth2.GoogleCredentials;
import lombok.*;
import lombok.experimental.SuperBuilder;
import io.kestra.core.exceptions.IllegalVariableEvaluationException;
import io.kestra.core.models.tasks.Task;
import io.kestra.core.runners.RunContext;

import java.io.IOException;
import java.util.Collections;
import java.util.List;

@SuperBuilder
@ToString
@EqualsAndHashCode
@Getter
@NoArgsConstructor
public abstract class AbstractTask extends Task implements GcpInterface {
    protected String projectId;

    protected String serviceAccount;

    protected String impersonatedServiceAccount;

    @Builder.Default
    protected List scopes = Collections.singletonList("https://www.googleapis.com/auth/cloud-platform");

    public GoogleCredentials credentials(RunContext runContext) throws IllegalVariableEvaluationException, IOException {
        return CredentialService.credentials(runContext, this);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy