Class: Google::Apis::GamesV1::PlayerGameEvent

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/games_v1/classes.rb,
lib/google/apis/games_v1/representations.rb,
lib/google/apis/games_v1/representations.rb

Overview

A representation of a single player game event triggered by a player's event in a game. This might be completing a level, unlocking an item, or finishing a match.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ PlayerGameEvent

Returns a new instance of PlayerGameEvent.



2259
2260
2261
# File 'lib/google/apis/games_v1/classes.rb', line 2259

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#event_idString

Required. A unique client-generated UUID for this specific event instance. Used for server-side idempotency and deduplication. Submitting an event with a previously recorded event_id for the same player will be ignored. Corresponds to the JSON property eventId

Returns:

  • (String)


2239
2240
2241
# File 'lib/google/apis/games_v1/classes.rb', line 2239

def event_id
  @event_id
end

#event_nameString

Required. Client-defined name of the event (e.g., "run_completed", "level_up"). Maximum length: 100 characters. Corresponds to the JSON property eventName

Returns:

  • (String)


2245
2246
2247
# File 'lib/google/apis/games_v1/classes.rb', line 2245

def event_name
  @event_name
end

#event_propertiesHash<String,Google::Apis::GamesV1::PropertyValue>

Optional. Key-value properties providing details about the event. - Maximum number of properties: 25. - Property key maximum length: 100 characters. - String values within PropertyValue maximum length: 1024 characters. Corresponds to the JSON property eventProperties

Returns:



2252
2253
2254
# File 'lib/google/apis/games_v1/classes.rb', line 2252

def event_properties
  @event_properties
end

#event_timeString

Required. The time from the client when this specific event was performed. Corresponds to the JSON property eventTime

Returns:

  • (String)


2257
2258
2259
# File 'lib/google/apis/games_v1/classes.rb', line 2257

def event_time
  @event_time
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2264
2265
2266
2267
2268
2269
# File 'lib/google/apis/games_v1/classes.rb', line 2264

def update!(**args)
  @event_id = args[:event_id] if args.key?(:event_id)
  @event_name = args[:event_name] if args.key?(:event_name)
  @event_properties = args[:event_properties] if args.key?(:event_properties)
  @event_time = args[:event_time] if args.key?(:event_time)
end