Documentation
¶
Index ¶
- Constants
- Variables
- type AuthToken
- type AuthenticationClient
- type Client
- func (c *Client) BattlePassLoot(ctx context.Context, title GameTitle, platform Platform, season int64) (*models.BattlePassLootResponse, error)
- func (c *Client) CODPoints(ctx context.Context, title GameTitle, gamer *Gamer) (*models.CodPointsResponse, error)
- func (c *Client) FriendsStats(ctx context.Context, title GameTitle, gamer *Gamer, gameType GameType) (*models.FriendStatsResponse, error)
- func (c *Client) FullMatchInfo(ctx context.Context, title GameTitle, platform Platform, gameType GameType, ...) (*models.FullMatchInfoResponse, error)
- func (c *Client) GamerLoot(ctx context.Context, title GameTitle, gamer *Gamer) (*models.GamerLootResponse, error)
- func (c *Client) GamerMatchDetails(ctx context.Context, title GameTitle, gamer *Gamer, gameType GameType, ...) (*models.GamerMatchDetailsResponse, error)
- func (c *Client) GamerMatchList(ctx context.Context, title GameTitle, gamer *Gamer, gameType GameType, ...) (*models.GamerMatchListResponse, error)
- func (c *Client) GamerStats(ctx context.Context, title GameTitle, gamer *Gamer, gameType GameType) (*models.GamerStatsResponse, error)
- func (c *Client) LeaderBoard(ctx context.Context, title GameTitle, platform Platform, page int64) (*models.LeaderBoardResponse, error)
- func (c *Client) Loadout(ctx context.Context, title GameTitle, gameType GameType) (*models.LoadoutResponse, error)
- func (c *Client) LoggedIn() error
- func (c *Client) Login(ctx context.Context, deviceId string, email string, password string, ...) (*models.LoginResponse, error)
- func (c *Client) MapList(ctx context.Context, title GameTitle, platform Platform, gameType GameType) (*models.MapListResponse, error)
- func (c *Client) MatchAnalysis(ctx context.Context, title GameTitle, gamer *Gamer, end int64) (*models.MatchAnalysisResponse, error)
- func (c *Client) Purchasable(ctx context.Context, title GameTitle, platform Platform) (*models.PurchasableResponse, error)
- func (c *Client) RegisterDevice(ctx context.Context, deviceId string) (*models.RegisterDeviceResponse, error)
- type GameTitle
- type GameType
- type Gamer
- type LookupType
- type Platform
- type ServiceClient
- type TransportConfig
Constants ¶
const ( // API request DefaultServiceHost = "my.callofduty.com" DefaultServiceBasePath = "/api/papi-client" DefaultAuthenticationHost = "profile.callofduty.com" DefaultAuthenticationBasePath = "/" ActSSOCookie = "ACT_SSO_COOKIE" // game title ColdWar GameTitle = "cw" ModernWarfare GameTitle = "mw" // game types Multiplayer GameType = "mp" Warzone GameType = "wz" // platforms Battlenet Platform = "battle" // Lookup type BattlenetLookup LookupType = "gamer" )
Variables ¶
var DefaultSchemes = []string{"https"}
Functions ¶
This section is empty.
Types ¶
type AuthToken ¶
type AuthToken struct {
ActSSOCookie string
}
Stores the Authentication for all authenticated requests
type AuthenticationClient ¶
type AuthenticationClient struct { Operations authentication.ClientService Transport runtime.ClientTransport }
AuthenticationClient is the client containing authentication operations
func NewAuthenticationClient ¶
func NewAuthenticationClient(transport runtime.ClientTransport, formats strfmt.Registry) *AuthenticationClient
New creates a new Authentication client
func NewAuthenticationClientWithConfig ¶
func NewAuthenticationClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *AuthenticationClient
NewAuthenticationClientWithConfig creates a new Authentication client with config
func (*AuthenticationClient) SetTransport ¶
func (c *AuthenticationClient) SetTransport(transport runtime.ClientTransport)
SetTransport changes the transport on the Authentication client and all its subresources
type Client ¶
type Client struct { AuthenticationClient *AuthenticationClient ServiceClient *ServiceClient AuthToken *AuthToken }
Go COD Client contains both an Authentication and Service Client
- Authentication client is usedfor authentication
- Service client is for common api requests
func (*Client) BattlePassLoot ¶
func (c *Client) BattlePassLoot(ctx context.Context, title GameTitle, platform Platform, season int64) (*models.BattlePassLootResponse, error)
BattlePassLoot returns the available loots for the specified battle pass season
func (*Client) CODPoints ¶
func (c *Client) CODPoints(ctx context.Context, title GameTitle, gamer *Gamer) (*models.CodPointsResponse, error)
CODPoints returns the gamer COD Points. Authentication required
func (*Client) FriendsStats ¶
func (c *Client) FriendsStats(ctx context.Context, title GameTitle, gamer *Gamer, gameType GameType) (*models.FriendStatsResponse, error)
FriendsStats returns the friend stats profile. Authentication required
func (*Client) FullMatchInfo ¶
func (c *Client) FullMatchInfo(ctx context.Context, title GameTitle, platform Platform, gameType GameType, matchId string) (*models.FullMatchInfoResponse, error)
FullMatchInfo returns the match information
func (*Client) GamerLoot ¶
func (c *Client) GamerLoot(ctx context.Context, title GameTitle, gamer *Gamer) (*models.GamerLootResponse, error)
GamerLoot returns the gamer loots. Authentication required
func (*Client) GamerMatchDetails ¶
func (c *Client) GamerMatchDetails(ctx context.Context, title GameTitle, gamer *Gamer, gameType GameType, start int64, end int64, limit int32) (*models.GamerMatchDetailsResponse, error)
GamerMatchDetails returns the gamer match details. Authentication required
func (*Client) GamerMatchList ¶
func (c *Client) GamerMatchList(ctx context.Context, title GameTitle, gamer *Gamer, gameType GameType, start int64, end int64, limit int32) (*models.GamerMatchListResponse, error)
GamerMatchList returns a list of gamer matches. Authentication required
func (*Client) GamerStats ¶
func (c *Client) GamerStats(ctx context.Context, title GameTitle, gamer *Gamer, gameType GameType) (*models.GamerStatsResponse, error)
GamerStats returns the gamer stats profile. Authentication required
func (*Client) LeaderBoard ¶
func (c *Client) LeaderBoard(ctx context.Context, title GameTitle, platform Platform, page int64) (*models.LeaderBoardResponse, error)
LeaderBoard returns the leader board details
func (*Client) Loadout ¶
func (c *Client) Loadout(ctx context.Context, title GameTitle, gameType GameType) (*models.LoadoutResponse, error)
Loadout returns all the loadout information
func (*Client) Login ¶
func (c *Client) Login(ctx context.Context, deviceId string, email string, password string, token string) (*models.LoginResponse, error)
Login uses the token received from register device authHeader, then returns cookie security tokens
used for all authenticated requests
func (*Client) MapList ¶
func (c *Client) MapList(ctx context.Context, title GameTitle, platform Platform, gameType GameType) (*models.MapListResponse, error)
Map List returns a list of maps and its available game modes
func (*Client) MatchAnalysis ¶
func (c *Client) MatchAnalysis(ctx context.Context, title GameTitle, gamer *Gamer, end int64) (*models.MatchAnalysisResponse, error)
MatchAnalysis returns the full match information. Authentication required
func (*Client) Purchasable ¶
func (c *Client) Purchasable(ctx context.Context, title GameTitle, platform Platform) (*models.PurchasableResponse, error)
Purchasable returns all the purchasable items
func (*Client) RegisterDevice ¶
func (c *Client) RegisterDevice(ctx context.Context, deviceId string) (*models.RegisterDeviceResponse, error)
RegisterDevice registers the device and returns the Auth Header token
type Gamer ¶
type Gamer struct { Platform Platform LookupType LookupType GamerTag string }
Gamer ID details
type LookupType ¶
type LookupType string
type ServiceClient ¶
type ServiceClient struct { Operations service.ClientService Transport runtime.ClientTransport }
ServiceClient is the client containing common service operations
func NewServiceClient ¶
func NewServiceClient(transport runtime.ClientTransport, formats strfmt.Registry) *ServiceClient
New creates a new Service client
func NewServiceClientWithConfig ¶
func NewServiceClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *ServiceClient
NewServiceClientWithConfig creates a new Service client with config
func (*ServiceClient) SetTransport ¶
func (c *ServiceClient) SetTransport(transport runtime.ClientTransport)
SetTransport changes the transport on the Service client and all its subresources
type TransportConfig ¶
TransportConfig contains the transport related info
func DefaultAuthTransportConfig ¶
func DefaultAuthTransportConfig() *TransportConfig
DefaultAuthTransportConfig creates a TransportConfig with the default settings for the Authentication Client
func DefaultServiceTransportConfig ¶
func DefaultServiceTransportConfig() *TransportConfig
DefaultServiceTransportConfig creates a TransportConfig with the default settings for the Service Client
func (*TransportConfig) WithBasePath ¶
func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig
WithBasePath overrides the default basePath
func (*TransportConfig) WithHost ¶
func (cfg *TransportConfig) WithHost(host string) *TransportConfig
WithHost overrides the default host
func (*TransportConfig) WithSchemes ¶
func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig
WithSchemes overrides the default schemes