Packages
Google Play Games Services API client library. The Google Play Games Service allows developers to enhance games with social leaderboards, achievements, game state, sign-in with Google, and more.
Current section
Files
Jump to
Current section
Files
lib/google_api/games/v1/model/room_participant.ex
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.
defmodule GoogleApi.Games.V1.Model.RoomParticipant do
@moduledoc """
This is a JSON template for a participant in a room.
## Attributes
- autoMatched (Boolean): True if this participant was auto-matched with the requesting player. Defaults to: `null`.
- autoMatchedPlayer (AnonymousPlayer): Information about a player that has been anonymously auto-matched against the requesting player. (Either player or autoMatchedPlayer will be set.) Defaults to: `null`.
- capabilities (List[String]): The capabilities which can be used when communicating with this participant. Defaults to: `null`.
- clientAddress (RoomClientAddress): Client address for the participant. Defaults to: `null`.
- connected (Boolean): True if this participant is in the fully connected set of peers in the room. Defaults to: `null`.
- id (String): An identifier for the participant in the scope of the room. Cannot be used to identify a player across rooms or in other contexts. Defaults to: `null`.
- kind (String): Uniquely identifies the type of this resource. Value is always the fixed string games#roomParticipant. Defaults to: `null`.
- leaveReason (String): The reason the participant left the room; populated if the participant status is PARTICIPANT_LEFT. Possible values are: - \"PLAYER_LEFT\" - The player explicitly chose to leave the room. - \"GAME_LEFT\" - The game chose to remove the player from the room. - \"ABANDONED\" - The player switched to another application and abandoned the room. - \"PEER_CONNECTION_FAILURE\" - The client was unable to establish or maintain a connection to other peer(s) in the room. - \"SERVER_ERROR\" - The client received an error response when it tried to communicate with the server. - \"TIMEOUT\" - The client timed out while waiting for players to join and connect. - \"PRESENCE_FAILURE\" - The client's XMPP connection ended abruptly. Defaults to: `null`.
- player (Player): Information about the player. Not populated if this player was anonymously auto-matched against the requesting player. (Either player or autoMatchedPlayer will be set.) Defaults to: `null`.
- status (String): The status of the participant with respect to the room. Possible values are: - \"PARTICIPANT_INVITED\" - The participant has been invited to join the room, but has not yet responded. - \"PARTICIPANT_JOINED\" - The participant has joined the room (either after creating it or accepting an invitation.) - \"PARTICIPANT_DECLINED\" - The participant declined an invitation to join the room. - \"PARTICIPANT_LEFT\" - The participant joined the room and then left it. Defaults to: `null`.
"""
defstruct [
:"autoMatched",
:"autoMatchedPlayer",
:"capabilities",
:"clientAddress",
:"connected",
:"id",
:"kind",
:"leaveReason",
:"player",
:"status"
]
end
defimpl Poison.Decoder, for: GoogleApi.Games.V1.Model.RoomParticipant do
import GoogleApi.Games.V1.Deserializer
def decode(value, options) do
value
|> deserialize(:"autoMatchedPlayer", :struct, GoogleApi.Games.V1.Model.AnonymousPlayer, options)
|> deserialize(:"clientAddress", :struct, GoogleApi.Games.V1.Model.RoomClientAddress, options)
|> deserialize(:"player", :struct, GoogleApi.Games.V1.Model.Player, options)
end
end
defimpl Poison.Encoder, for: GoogleApi.Games.V1.Model.RoomParticipant do
def encode(value, options) do
GoogleApi.Games.V1.Deserializer.serialize_non_nil(value, options)
end
end