Google-Cloud-Privateca-V1
view release on metacpan or search on metacpan
lib/Google/Cloud/Security/Privateca/V1/Service.pm view on Meta::CPAN
my $msg = Google::Cloud::Security::Privateca::V1::Service::OperationMetadata->new(
create_time => $value,
);
=head1 FIELDS
=over 4
=item * B<create_time>
Type: Message (.google.protobuf.Timestamp)
=item * B<end_time>
Type: Message (.google.protobuf.Timestamp)
=item * B<target>
Type: String
=item * B<verb>
Type: String
=item * B<status_message>
Type: String
=item * B<requested_cancellation>
Type: Bool
=item * B<api_version>
Type: String
=back
=cut
# === Service Client: Google::Cloud::Security::Privateca::V1::Service::CertificateAuthorityServiceClient ===
package Google::Cloud::Security::Privateca::V1::Service::CertificateAuthorityServiceClient;
=pod
=head1 NAME
Google::Cloud::Security::Privateca::V1::Service::CertificateAuthorityServiceClient - Client stub representing the remote CertificateAuthorityService 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<security.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 => 'security.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_certificate {
my ($self, $args) = @_;
my $req = ref($args) eq 'HASH'
? Google::Cloud::Security::Privateca::V1::Service::CreateCertificateRequest->new($args)
: $args;
return $self->_grpc_client->call({
service => 'google.cloud.security.privateca.v1.CertificateAuthorityService',
method => 'CreateCertificate',
request => $req,
response_class => 'Google::Cloud::Security::Privateca::V1::Resources::Certificate',
});
}
sub get_certificate {
my ($self, $args) = @_;
my $req = ref($args) eq 'HASH'
? Google::Cloud::Security::Privateca::V1::Service::GetCertificateRequest->new($args)
: $args;
return $self->_grpc_client->call({
service => 'google.cloud.security.privateca.v1.CertificateAuthorityService',
method => 'GetCertificate',
request => $req,
response_class => 'Google::Cloud::Security::Privateca::V1::Resources::Certificate',
});
}
sub list_certificates {
my ($self, $args) = @_;
my $req = ref($args) eq 'HASH'
? Google::Cloud::Security::Privateca::V1::Service::ListCertificatesRequest->new($args)
: $args;
return $self->_grpc_client->call({
service => 'google.cloud.security.privateca.v1.CertificateAuthorityService',
method => 'ListCertificates',
( run in 2.444 seconds using v1.01-cache-2.11-cpan-81fc1098f69 )