package Google::Cloud::Bigquery::V2::Project;

use strict;
use warnings;

our $VERSION = '0.04';

use Protobuf::Message;
use Protobuf::DescriptorPool;
use Protobuf::Internal qw(:all);
use MIME::Base64;

BEGIN {
    eval { require Google::Api::Annotations };
    eval { require Google::Api::Client };
    eval { require Google::Api::FieldBehavior };
    my $descriptor_b64 = <<'EOF';
CiZnb29nbGUvY2xvdWQvYmlncXVlcnkvdjIvcHJvamVjdC5wcm90bxIYZ29vZ2xlLmNsb3Vk
LmJpZ3F1ZXJ5LnYyGhxnb29nbGUvYXBpL2Fubm90YXRpb25zLnByb3RvGhdnb29nbGUvYXBp
L2NsaWVudC5wcm90bxofZ29vZ2xlL2FwaS9maWVsZF9iZWhhdmlvci5wcm90byI+ChhHZXRT
ZXJ2aWNlQWNjb3VudFJlcXVlc3QSIgoKcHJvamVjdF9pZBgBIAEoCUID4EECUglwcm9qZWN0
SWQiRQoZR2V0U2VydmljZUFjY291bnRSZXNwb25zZRISCgRraW5kGAEgASgJUgRraW5kEhQK
BWVtYWlsGAIgASgJUgVlbWFpbDL9AgoOUHJvamVjdFNlcnZpY2USuQEKEUdldFNlcnZpY2VB
Y2NvdW50EjIuZ29vZ2xlLmNsb3VkLmJpZ3F1ZXJ5LnYyLkdldFNlcnZpY2VBY2NvdW50UmVx
dWVzdBozLmdvb2dsZS5jbG91ZC5iaWdxdWVyeS52Mi5HZXRTZXJ2aWNlQWNjb3VudFJlc3Bv
bnNlIjuC0+STAjUSMy9iaWdxdWVyeS92Mi9wcm9qZWN0cy97cHJvamVjdF9pZD0qfS9zZXJ2
aWNlQWNjb3VudBquAcpBF2JpZ3F1ZXJ5Lmdvb2dsZWFwaXMuY29t0kGQAWh0dHBzOi8vd3d3
Lmdvb2dsZWFwaXMuY29tL2F1dGgvYmlncXVlcnksaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5j
b20vYXV0aC9jbG91ZC1wbGF0Zm9ybSxodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9hdXRo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MCgUEAQIBARIDOAkOCgwKBQQBAgEDEgM4ERJiBnByb3RvMw==
EOF
    Protobuf::DescriptorPool->generated_pool->add_serialized_file(MIME::Base64::decode_base64($descriptor_b64));
}

# Message definitions

# === Message: Google::Cloud::Bigquery::V2::Project::GetServiceAccountRequest ===
    # Fields for GetServiceAccountRequest
    # Field: project_id Type: 9 ()

=pod

=head1 NAME

Google::Cloud::Bigquery::V2::Project::GetServiceAccountRequest - Compiled Protocol Buffers message class

=head1 SYNOPSIS

    use Google::Cloud::Bigquery::V2::Project;

    my $msg = Google::Cloud::Bigquery::V2::Project::GetServiceAccountRequest->new(
        project_id => $value,
    );

=head1 FIELDS

=over 4

=item * B<project_id>

Type: String

=back

=cut

# === Message: Google::Cloud::Bigquery::V2::Project::GetServiceAccountResponse ===
    # Fields for GetServiceAccountResponse
    # Field: kind Type: 9 ()
    # Field: email Type: 9 ()

=pod

=head1 NAME

Google::Cloud::Bigquery::V2::Project::GetServiceAccountResponse - Compiled Protocol Buffers message class

=head1 SYNOPSIS

    use Google::Cloud::Bigquery::V2::Project;

    my $msg = Google::Cloud::Bigquery::V2::Project::GetServiceAccountResponse->new(
        kind => $value,
    );

=head1 FIELDS

=over 4

=item * B<kind>

Type: String

=item * B<email>

Type: String

=back

=cut

# === Service Client: Google::Cloud::Bigquery::V2::Project::ProjectServiceClient ===
package Google::Cloud::Bigquery::V2::Project::ProjectServiceClient;

=pod

=head1 NAME

Google::Cloud::Bigquery::V2::Project::ProjectServiceClient - Client stub representing the remote ProjectService 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<bigquery.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 => 'bigquery.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 get_service_account {
    my ($self, $args) = @_;
    my $req = ref($args) eq 'HASH'
        ? Google::Cloud::Bigquery::V2::Project::GetServiceAccountRequest->new($args)
        : $args;
    return $self->_grpc_client->call({
        service        => 'google.cloud.bigquery.v2.ProjectService',
        method         => 'GetServiceAccount',
        request        => $req,
        response_class => 'Google::Cloud::Bigquery::V2::Project::GetServiceAccountResponse',
    });
}

1;

__END__

=head1 NAME

Google::Cloud::Bigquery::V2::Project - 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
