class Google::Cloud::Logging::Entry::Operation
Additional information about a potentially long-running operation with which a log entry is associated.
See also {Google::Cloud::Logging::Entry#operation}.
Attributes
Set this to `true` if this is the first log entry in the operation.
An arbitrary operation identifier. Log
entries with the same identifier are assumed to be part of the same operation.
Set this to `true` if this is the last log entry in the operation.
An arbitrary producer identifier. The combination of `id` and `producer` must be globally unique. Examples for `producer`: `“MyDivision.MyBigCompany.com”`, `“github.com/MyProject/MyApplication”`.
Public Class Methods
@private New Google::Cloud::Logging::Entry::Operation
from a Google::Cloud::Logging::V2::LogEntryOperation object.
# File lib/google/cloud/logging/entry/operation.rb, line 79 def self.from_grpc grpc return new if grpc.nil? new.tap do |o| o.id = grpc.id o.producer = grpc.producer o.first = grpc.first o.last = grpc.last end end
@private Create an empty Operation
object.
# File lib/google/cloud/logging/entry/operation.rb, line 31 def initialize end
Public Instance Methods
@private Determines if the Operation
has any data.
# File lib/google/cloud/logging/entry/operation.rb, line 56 def empty? id.nil? && producer.nil? && first.nil? && last.nil? end
@private Exports the Operation
to a Google::Cloud::Logging::V2::LogEntryOperation object.
# File lib/google/cloud/logging/entry/operation.rb, line 66 def to_grpc return nil if empty? Google::Cloud::Logging::V2::LogEntryOperation.new( id: id.to_s, producer: producer.to_s, first: !(!first), last: !(!last) ) end