NAME

Protobuf::WKT::FieldMask - Mixin for google.protobuf.FieldMask

VERSION

version 0.03

SYNOPSIS

# In your .proto
import "google/protobuf/field_mask.proto";

message UpdateUserRequest {
  User user = 1;
  google.protobuf.FieldMask update_mask = 2;
}

# In your Perl code
my $req = UpdateUserRequest->new;
my $mask = $req->update_mask;

# Setting from string
$mask->from_string('display_name,email');
# $mask->paths is now ['display_name', 'email']

# Getting as string
my $mask_string = $mask->to_string(); # Returns "display_name,email"

DESCRIPTION

This module provides helper methods for the generated class corresponding to the google.protobuf.FieldMask Well-Known Type. These methods are injected into the Protobuf::WKT::FieldMask class, which should be automatically used when google/protobuf/field_mask.proto is processed.

The FieldMask type is used to specify a subset of fields that should be returned by a get operation or modified by an update operation.

METHODS

to_string()

Returns the field mask paths as a single comma-separated string.

from_string($str)

Parses a comma-separated string and populates the paths repeated field.

Returns $self for chaining.

get_injected_methods()

Internal method used by Protobuf::ClassGenerator to list methods to inject into the class.

SEE ALSO

Protobuf, Protobuf::Message

AUTHOR

C.J. Collier <cjac@google.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Google LLC.

This is free software; you can redistribute it and/or modify it under the terms of the BSD 3-Clause License.