playfab

package
v0.0.0-...-e9941a8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAPIError

func IsAPIError(err error) bool

Types

type APIErrorResponse

type APIErrorResponse struct {
	APIResponse  `json:"-"`
	AError       string                 `json:"error"`
	ErrorCode    int                    `json:"errorCode"`
	ErrorDetails map[string]interface{} `json:"errorDetails"`
	ErrorMessage string                 `json:"errorMessage"`
}

func (*APIErrorResponse) Error

func (e *APIErrorResponse) Error() string

func (*APIErrorResponse) GetErrorCode

func (e *APIErrorResponse) GetErrorCode() int

type APIErrorWrapper

type APIErrorWrapper interface {
	GetErrorCode() int
}

type APIResponse

type APIResponse struct {
	Code   int         `json:"code"`
	Status string      `json:"status"`
	Data   interface{} `json:"data"`
}

type CancelAllMatchmakingTicketsForPlayerRequest

type CancelAllMatchmakingTicketsForPlayerRequest struct {
	QueueName  string            `json:"QueueName"`
	CustomTags map[string]string `json:"CustomTags"`
	Entity     EntityKey         `json:"Entity"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewPlayFabClient

func NewPlayFabClient() *Client

func (*Client) CancelAllMatchmakingTicketsForPlayer

func (c *Client) CancelAllMatchmakingTicketsForPlayer(ctx context.Context, entityToken EntityToken, request *CancelAllMatchmakingTicketsForPlayerRequest) error

func (*Client) CreateMatchMakingTicket

func (c *Client) CreateMatchMakingTicket(ctx context.Context, entityToken EntityToken, request *CreateMatchMakingTicketRequest) (*CreateMatchMakingTicketResponse, error)

func (*Client) GetMatch

func (c *Client) GetMatch(ctx context.Context, entityToken EntityToken, request *GetMatchRequest) (*GetMatchResponse, error)

func (*Client) GetMatchmakingTicket

func (c *Client) GetMatchmakingTicket(ctx context.Context, entityToken EntityToken, request *GetMatchMakingTicketRequest) (*GetMatchMakingTicketResponse, error)

func (*Client) GetTitleEntityToken

func (c *Client) GetTitleEntityToken(ctx context.Context) (*EntityToken, error)

func (*Client) ListMatchmakingTicketsForPlayer

func (c *Client) ListMatchmakingTicketsForPlayer(ctx context.Context, entityToken EntityToken, request *ListMatchmakingTicketsForPlayerRequest) (*ListMatchmakingTicketsForPlayerResponse, error)

func (*Client) LoginWithCustomID

func (c *Client) LoginWithCustomID(ctx context.Context, request *ServerLoginWithCustomIDRequest) (*ServerLoginResponse, error)

func (*Client) UpdateUserData

func (c *Client) UpdateUserData(ctx context.Context, playfabID string, request *ServerUpdateUserDataRequest) (*UpdateUserDataResponse, error)

type CreateMatchMakingTicketRequest

type CreateMatchMakingTicketRequest struct {
	Creator            MatchmakingPlayer `json:"Creator"`
	GiveUpAfterSeconds int64             `json:"GiveUpAfterSeconds"`
	QueueName          string            `json:"QueueName"`
	CustomTags         map[string]string `json:"CustomTags"`
	MembersToMatchWith []EntityKey       `json:"MembersToMatchWith"`
}

type CreateMatchMakingTicketResponse

type CreateMatchMakingTicketResponse struct {
	TicketId string `json:"TicketId"`
}

type EntityKey

type EntityKey struct {
	Id   string `json:"Id"`
	Type string `json:"Type"`
}

type EntityToken

type EntityToken struct {
	Entity          EntityKey `json:"Entity"`
	EntityToken     string    `json:"EntityToken"`
	TokenExpiration string    `json:"TokenExpiration"`
}

type GetEntityTokenRequest

type GetEntityTokenRequest struct {
	CustomTags map[string]string `json:"CustomTags"`
	Entity     EntityKey         `json:"Entity"`
}

type GetMatchMakingTicketRequest

type GetMatchMakingTicketRequest struct {
	EscapeObject bool              `json:"EscapeObject"`
	QueueName    string            `json:"QueueName"`
	TicketId     string            `json:"TicketId"`
	CustomTags   map[string]string `json:"CustomTags"`
}

type GetMatchMakingTicketResponse

type GetMatchMakingTicketResponse struct {
	CancellationReasonString string              `json:"CancellationReasonString"`
	ChangeNumber             int                 `json:"ChangeNumber"`
	Created                  time.Time           `json:"Created"`
	Creator                  MatchmakingPlayer   `json:"Creator"`
	GiveUpAfterSeconds       int64               `json:"GiveUpAfterSeconds"`
	MatchId                  *string             `json:"MatchId"`
	Members                  []MatchmakingPlayer `json:"Members"`
	MembersToMatchWith       []EntityKey         `json:"MembersToMatchWith"`
	QueueName                string              `json:"QueueName"`
	Status                   string              `json:"Status"`
	TicketId                 string              `json:"TicketId"`
}

type GetMatchRequest

type GetMatchRequest struct {
	EscapeObject           bool              `json:"EscapeObject"`
	MatchId                string            `json:"MatchId"`
	QueueName              string            `json:"QueueName"`
	ReturnMemberAttributes bool              `json:"ReturnMemberAttributes"`
	CustomTags             map[string]string `json:"CustomTags"`
}

type GetMatchResponse

type GetMatchResponse struct {
	ArrangementString string                                `json:"ArrangementString"`
	MatchId           string                                `json:"MatchId"`
	Members           []MatchmakingPlayerWithTeamAssignment `json:"Members"`
	RegionPreferences []string                              `json:"RegionPreferences"`
	ServerDetails     *ServerDetails                        `json:"ServerDetails"`
}

type ItemInstanceResponse

type ItemInstanceResponse struct {
	Annotation        string            `json:"Annotation"`
	BundleContents    []string          `json:"BundleContents"`
	BundleParent      string            `json:"BundleParent"`
	CatalogVersion    string            `json:"CatalogVersion"`
	CustomData        map[string]string `json:"CustomData"`
	DisplayName       string            `json:"DisplayName"`
	Expiration        time.Time         `json:"Expiration"`
	ItemClass         string            `json:"ItemClass"`
	ItemId            string            `json:"ItemId"`
	ItemInstanceId    string            `json:"ItemInstanceId"`
	PurchaseDate      time.Time         `json:"PurchaseDate"`
	RemainingUses     int               `json:"RemainingUses"`
	UnitCurrency      string            `json:"UnitCurrency"`
	UnitPrice         int               `json:"UnitPrice"`
	UsesIncrementedBy int               `json:"UsesIncrementedBy"`
}

type ListMatchmakingTicketsForPlayerRequest

type ListMatchmakingTicketsForPlayerRequest struct {
	QueueName  string            `json:"QueueName"`
	CustomTags map[string]string `json:"CustomTags"`
	Entity     EntityKey         `json:"Entity"`
}

type ListMatchmakingTicketsForPlayerResponse

type ListMatchmakingTicketsForPlayerResponse struct {
	TicketIds []string `json:"TicketIds"`
}

type MatchmakingPlayer

type MatchmakingPlayer struct {
	Attributes MatchmakingPlayerAttributes `json:"Attributes"`
	Entity     EntityKey                   `json:"Entity"`
}

type MatchmakingPlayerAttributes

type MatchmakingPlayerAttributes struct {
	DataObject        map[string]interface{} `json:"DataObject,omitempty"`
	EscapedDataObject *string                `json:"EscapedDataObject,omitempty"`
}

type MatchmakingPlayerWithTeamAssignment

type MatchmakingPlayerWithTeamAssignment struct {
	Attributes MatchmakingPlayerAttributes `json:"Attributes"`
	Entity     EntityKey                   `json:"Entity"`
	TeamId     *string                     `json:"TeamId"`
}

type PlayerCombinedInfoRequestParams

type PlayerCombinedInfoRequestParams struct {
	GetCharacterInventories *bool                                `json:"GetCharacterInventories,omitempty"`
	GetCharacterList        *bool                                `json:"GetCharacterList,omitempty"`
	GetPlayerProfile        *bool                                `json:"GetPlayerProfile,omitempty"`
	GetPlayerStatistics     *bool                                `json:"GetPlayerStatistics,omitempty"`
	GetTitleData            *bool                                `json:"GetTitleData,omitempty"`
	GetUserAccountInfo      *bool                                `json:"GetUserAccountInfo,omitempty"`
	GetUserData             *bool                                `json:"GetUserData,omitempty"`
	GetUserInventory        *bool                                `json:"GetUserInventory,omitempty"`
	GetUserReadOnlyData     *bool                                `json:"GetUserReadOnlyData,omitempty"`
	GetUserVirtualCurrency  *bool                                `json:"GetUserVirtualCurrency,omitempty"`
	PlayerStatisticNames    []string                             `json:"PlayerStatisticNames,omitempty"`
	ProfileConstraints      *PlayerProfileViewConstraintsRequest `json:"ProfileConstraints,omitempty"`
	TitleDataKeys           []string                             `json:"TitleDataKeys,omitempty"`
	UserDataKeys            []string                             `json:"UserDataKeys,omitempty"`
	UserReadOnlyDataKeys    []string                             `json:"UserReadOnlyDataKeys,omitempty"`
}

type PlayerCombinedInfoResponse

type PlayerCombinedInfoResponse struct {
	AccountInfo                      interface{}                         `json:"AccountInfo"`
	CharacterInventories             []interface{}                       `json:"CharacterInventories"`
	CharacterList                    []interface{}                       `json:"CharacterList"`
	PlayerProfile                    interface{}                         `json:"PlayerProfile"`
	PlayerStatistics                 []PlayerStatisticValueResponse      `json:"PlayerStatistics"`
	TitleData                        map[string]string                   `json:"TitleData"`
	UserData                         map[string]UserDataRecordResponse   `json:"UserData"`
	UserDataVersion                  int                                 `json:"UserDataVersion"`
	UserInventory                    []ItemInstanceResponse              `json:"UserInventory"`
	UserReadOnlyData                 map[string]UserDataRecordResponse   `json:"UserReadOnlyData"`
	UserReadOnlyDataVersion          int                                 `json:"UserReadOnlyDataVersion"`
	UserVirtualCurrency              map[string]int                      `json:"UserVirtualCurrency"`
	UserVirtualCurrencyRechargeTimes VirtualCurrencyRechargeTimeResponse `json:"UserVirtualCurrencyRechargeTimes"`
}

type PlayerProfileViewConstraintsRequest

type PlayerProfileViewConstraintsRequest struct {
	ShowAvatarUrl                     *bool `json:"ShowAvatarUrl,omitempty"`
	ShowBannedUntil                   *bool `json:"ShowBannedUntil,omitempty"`
	ShowCampaignAttributions          *bool `json:"ShowCampaignAttributions,omitempty"`
	ShowContactEmailAddresses         *bool `json:"ShowContactEmailAddresses,omitempty"`
	ShowCreated                       *bool `json:"ShowCreated,omitempty"`
	ShowDisplayName                   *bool `json:"ShowDisplayName,omitempty"`
	ShowExperimentVariants            *bool `json:"ShowExperimentVariants,omitempty"`
	ShowLastLogin                     *bool `json:"ShowLastLogin,omitempty"`
	ShowLinkedAccounts                *bool `json:"ShowLinkedAccounts,omitempty"`
	ShowLocations                     *bool `json:"ShowLocations,omitempty"`
	ShowMemberships                   *bool `json:"ShowMemberships,omitempty"`
	ShowOrigination                   *bool `json:"ShowOrigination,omitempty"`
	ShowPushNotificationRegistrations *bool `json:"ShowPushNotificationRegistrations,omitempty"`
	ShowStatistics                    *bool `json:"ShowStatistics,omitempty"`
	ShowTags                          *bool `json:"ShowTags,omitempty"`
	ShowTotalValueToDateInUsd         *bool `json:"ShowTotalValueToDateInUsd,omitempty"`
	ShowValuesToDate                  *bool `json:"ShowValuesToDate,omitempty"`
}

type PlayerStatisticValueResponse

type PlayerStatisticValueResponse struct {
	StatisticName string `json:"StatisticName"`
	Value         int    `json:"Value"`
	Version       int    `json:"Version"`
}

type ServerDetails

type ServerDetails struct {
	FQDN        string       `json:"Fqdn"`
	IPV4Address string       `json:"IPV4Address"`
	Ports       []ServerPort `json:"Ports"`
	Region      string       `json:"Region"`
}

type ServerLoginResponse

type ServerLoginResponse struct {
	EntityToken         EntityToken                 `json:"EntityToken"`
	InfoResultPayload   PlayerCombinedInfoResponse  `json:"InfoResultPayload"`
	LastLoginTime       time.Time                   `json:"LastLoginTime"`
	NewlyCreated        bool                        `json:"NewlyCreated"`
	PlayFabId           string                      `json:"PlayFabId"`
	SessionTicket       string                      `json:"SessionTicket"`
	SettingsForUser     UserSettingsResponse        `json:"SettingsForUser"`
	TreatmentAssignment TreatmentAssignmentResponse `json:"TreatmentAssignment"`
}

type ServerLoginWithCustomIDRequest

type ServerLoginWithCustomIDRequest struct {
	CreateAccount         *bool                            `json:"CreateAccount,omitempty"`
	CustomTags            map[string]string                `json:"CustomTags,omitempty"`
	InfoRequestParameters *PlayerCombinedInfoRequestParams `json:"InfoRequestParameters,omitempty"`
	PlayerSecret          *string                          `json:"PlayerSecret,omitempty"`
	ServerCustomId        string                           `json:"ServerCustomId"`
}

type ServerPort

type ServerPort struct {
	Name     string `json:"Name"`
	Num      int    `json:"Num"`
	Protocol string `json:"Protocol"`
}

type ServerUpdateUserDataRequest

type ServerUpdateUserDataRequest struct {
	PlayFabId    string            `json:"PlayFabId"`
	CustomTags   map[string]string `json:"CustomTags"`
	Data         map[string]string `json:"Data"`
	KeysToRemove []string          `json:"KeysToRemove"`
	Permission   string            `json:"Permission"`
}

type TreatmentAssignmentResponse

type TreatmentAssignmentResponse struct {
	Variables []Variable `json:"Variables"`
	Variants  []string   `json:"Variants"`
}

type UpdateUserDataResponse

type UpdateUserDataResponse struct {
	DataVersion int `json:"DataVersion"`
}

type UserDataRecordResponse

type UserDataRecordResponse struct {
	LastUpdated time.Time `json:"LastUpdated"`
	Permission  string    `json:"Permission"`
	Value       string    `json:"Value"`
}

type UserSettingsResponse

type UserSettingsResponse struct {
	GatherDeviceInfo bool `json:"GatherDeviceInfo"`
	GatherFocusInfo  bool `json:"GatherFocusInfo"`
	NeedsAttribution bool `json:"NeedsAttribution"`
}

type Variable

type Variable struct {
	Name  string `json:"Name"`
	Value string `json:"Value"`
}

type VirtualCurrencyRechargeTimeResponse

type VirtualCurrencyRechargeTimeResponse struct {
	RechargeMax       int       `json:"RechargeMax"`
	RechargeTime      time.Time `json:"RechargeTime"`
	SecondsToRecharge int       `json:"SecondsToRecharge"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL