Google-Cloud-Dataproc-V1

 view release on metacpan or  search on metacpan

lib/Google/Cloud/Dataproc/V1/Jobs.pm  view on Meta::CPAN


# === Message: Google::Cloud::Dataproc::V1::Jobs::DeleteJobRequest ===
    # Fields for DeleteJobRequest
    # Field: project_id Type: 9 ()
    # Field: region Type: 9 ()
    # Field: job_id Type: 9 ()

=pod

=head1 NAME

Google::Cloud::Dataproc::V1::Jobs::DeleteJobRequest - Compiled Protocol Buffers message class

=head1 SYNOPSIS

    use Google::Cloud::Dataproc::V1::Jobs;

    my $msg = Google::Cloud::Dataproc::V1::Jobs::DeleteJobRequest->new(
        project_id => $value,
    );

=head1 FIELDS

=over 4

=item * B<project_id>

Type: String

=item * B<region>

Type: String

=item * B<job_id>

Type: String

=back

=cut

# === Service Client: Google::Cloud::Dataproc::V1::Jobs::JobControllerClient ===
package Google::Cloud::Dataproc::V1::Jobs::JobControllerClient;

=pod

=head1 NAME

Google::Cloud::Dataproc::V1::Jobs::JobControllerClient - Client stub representing the remote JobController service

=head1 DESCRIPTION

This class acts as a local client stub for the remote gRPC service.
It delegates call dispatching to an underlying L<Google::gRPC::Client>
instance, ensuring type-safe request parsing and response mapping.

=head1 CONFIGURATION AND ENVIRONMENT

=head2 target

The endpoint target address. Defaults to C<dataproc.googleapis.com:443>.

=head2 credentials

The authentication credentials provider. Defaults to application default credentials via L<Google::Auth>.

=cut

use Moo;
use Google::Auth;
use Google::gRPC::Client;

has credentials => ( is => 'ro', default => sub { Google::Auth->default() } );
has target      => ( is => 'ro', default => 'dataproc.googleapis.com:443' );

has _grpc_client => (
    is => 'ro',
    lazy => 1,
    builder => sub {
        my $self = shift;
        return Google::gRPC::Client->new(
            target     => $self->target,
            auth_token => $self->credentials->get_token(),
        );
    }
);

sub submit_job {
    my ($self, $args) = @_;
    my $req = ref($args) eq 'HASH'
        ? Google::Cloud::Dataproc::V1::Jobs::SubmitJobRequest->new($args)
        : $args;
    return $self->_grpc_client->call({
        service        => 'google.cloud.dataproc.v1.JobController',
        method         => 'SubmitJob',
        request        => $req,
        response_class => 'Google::Cloud::Dataproc::V1::Jobs::Job',
    });
}

sub submit_job_as_operation {
    my ($self, $args) = @_;
    my $req = ref($args) eq 'HASH'
        ? Google::Cloud::Dataproc::V1::Jobs::SubmitJobRequest->new($args)
        : $args;
    return $self->_grpc_client->call({
        service        => 'google.cloud.dataproc.v1.JobController',
        method         => 'SubmitJobAsOperation',
        request        => $req,
        response_class => 'Google::Longrunning::Operations::Operation',
    });
}

sub get_job {
    my ($self, $args) = @_;
    my $req = ref($args) eq 'HASH'
        ? Google::Cloud::Dataproc::V1::Jobs::GetJobRequest->new($args)
        : $args;
    return $self->_grpc_client->call({
        service        => 'google.cloud.dataproc.v1.JobController',
        method         => 'GetJob',



( run in 0.720 second using v1.01-cache-2.11-cpan-f03e8824b8d )