Google-Cloud-Dataflow-V1beta3
view release on metacpan or search on metacpan
lib/Google/Dataflow/V1beta3/Jobs.pm view on Meta::CPAN
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<dataflow.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 => 'dataflow.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 create_job {
my ($self, $args) = @_;
my $req = ref($args) eq 'HASH'
? Google::Dataflow::V1beta3::Jobs::CreateJobRequest->new($args)
: $args;
return $self->_grpc_client->call({
service => 'google.dataflow.v1beta3.JobsV1Beta3',
method => 'CreateJob',
request => $req,
response_class => 'Google::Dataflow::V1beta3::Jobs::Job',
});
}
sub get_job {
my ($self, $args) = @_;
my $req = ref($args) eq 'HASH'
? Google::Dataflow::V1beta3::Jobs::GetJobRequest->new($args)
: $args;
return $self->_grpc_client->call({
service => 'google.dataflow.v1beta3.JobsV1Beta3',
method => 'GetJob',
request => $req,
response_class => 'Google::Dataflow::V1beta3::Jobs::Job',
});
}
sub update_job {
my ($self, $args) = @_;
my $req = ref($args) eq 'HASH'
? Google::Dataflow::V1beta3::Jobs::UpdateJobRequest->new($args)
: $args;
return $self->_grpc_client->call({
service => 'google.dataflow.v1beta3.JobsV1Beta3',
method => 'UpdateJob',
request => $req,
response_class => 'Google::Dataflow::V1beta3::Jobs::Job',
});
}
sub list_jobs {
my ($self, $args) = @_;
my $req = ref($args) eq 'HASH'
? Google::Dataflow::V1beta3::Jobs::ListJobsRequest->new($args)
: $args;
return $self->_grpc_client->call({
service => 'google.dataflow.v1beta3.JobsV1Beta3',
method => 'ListJobs',
request => $req,
response_class => 'Google::Dataflow::V1beta3::Jobs::ListJobsResponse',
});
}
sub aggregated_list_jobs {
my ($self, $args) = @_;
my $req = ref($args) eq 'HASH'
? Google::Dataflow::V1beta3::Jobs::ListJobsRequest->new($args)
: $args;
return $self->_grpc_client->call({
service => 'google.dataflow.v1beta3.JobsV1Beta3',
method => 'AggregatedListJobs',
request => $req,
response_class => 'Google::Dataflow::V1beta3::Jobs::ListJobsResponse',
});
}
sub check_active_jobs {
my ($self, $args) = @_;
my $req = ref($args) eq 'HASH'
? Google::Dataflow::V1beta3::Jobs::CheckActiveJobsRequest->new($args)
: $args;
return $self->_grpc_client->call({
service => 'google.dataflow.v1beta3.JobsV1Beta3',
method => 'CheckActiveJobs',
request => $req,
response_class => 'Google::Dataflow::V1beta3::Jobs::CheckActiveJobsResponse',
});
}
sub snapshot_job {
my ($self, $args) = @_;
my $req = ref($args) eq 'HASH'
? Google::Dataflow::V1beta3::Jobs::SnapshotJobRequest->new($args)
: $args;
return $self->_grpc_client->call({
service => 'google.dataflow.v1beta3.JobsV1Beta3',
method => 'SnapshotJob',
request => $req,
( run in 1.036 second using v1.01-cache-2.11-cpan-7e94247ccb0 )