Google-Cloud-Metastore-V1

 view release on metacpan or  search on metacpan

lib/Google/Cloud/Metastore/V1/MetastoreFederation.pm  view on Meta::CPAN

=cut

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

has credentials => ( is => 'ro', default => sub { Google::Auth->default() } );
has target      => ( is => 'ro', default => 'metastore.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 list_federations {
    my ($self, $args) = @_;
    my $req = ref($args) eq 'HASH'
        ? Google::Cloud::Metastore::V1::MetastoreFederation::ListFederationsRequest->new($args)
        : $args;
    return $self->_grpc_client->call({
        service        => 'google.cloud.metastore.v1.DataprocMetastoreFederation',
        method         => 'ListFederations',
        request        => $req,
        response_class => 'Google::Cloud::Metastore::V1::MetastoreFederation::ListFederationsResponse',
    });
}

sub get_federation {
    my ($self, $args) = @_;
    my $req = ref($args) eq 'HASH'
        ? Google::Cloud::Metastore::V1::MetastoreFederation::GetFederationRequest->new($args)
        : $args;
    return $self->_grpc_client->call({
        service        => 'google.cloud.metastore.v1.DataprocMetastoreFederation',
        method         => 'GetFederation',
        request        => $req,
        response_class => 'Google::Cloud::Metastore::V1::MetastoreFederation::Federation',
    });
}

sub create_federation {
    my ($self, $args) = @_;
    my $req = ref($args) eq 'HASH'
        ? Google::Cloud::Metastore::V1::MetastoreFederation::CreateFederationRequest->new($args)
        : $args;
    return $self->_grpc_client->call({
        service        => 'google.cloud.metastore.v1.DataprocMetastoreFederation',
        method         => 'CreateFederation',
        request        => $req,
        response_class => 'Google::Longrunning::Operations::Operation',
    });
}

sub update_federation {
    my ($self, $args) = @_;
    my $req = ref($args) eq 'HASH'
        ? Google::Cloud::Metastore::V1::MetastoreFederation::UpdateFederationRequest->new($args)
        : $args;
    return $self->_grpc_client->call({
        service        => 'google.cloud.metastore.v1.DataprocMetastoreFederation',
        method         => 'UpdateFederation',
        request        => $req,
        response_class => 'Google::Longrunning::Operations::Operation',
    });
}

sub delete_federation {
    my ($self, $args) = @_;
    my $req = ref($args) eq 'HASH'
        ? Google::Cloud::Metastore::V1::MetastoreFederation::DeleteFederationRequest->new($args)
        : $args;
    return $self->_grpc_client->call({
        service        => 'google.cloud.metastore.v1.DataprocMetastoreFederation',
        method         => 'DeleteFederation',
        request        => $req,
        response_class => 'Google::Longrunning::Operations::Operation',
    });
}

1;

__END__

=head1 NAME

Google::Cloud::Metastore::V1::MetastoreFederation - Protocol Buffers schema definition

=head1 DESCRIPTION

Auto-generated Protocol Buffers schema definition class.

=head1 LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.

=cut



( run in 0.520 second using v1.01-cache-2.11-cpan-7e94247ccb0 )