Documentation ¶
Index ¶
- Constants
- type AssetsService
- type BatchRequest
- type ClientContext
- type Config
- type ConfigService
- type GetLicensesOption
- type GetUsersOption
- type LicenseAssociation
- type LicensesService
- type MetadataService
- type PricingParam
- type SToken
- type ServiceConfig
- type Status
- type UsersService
- type VPPAsset
- type VPPAssetAssignment
- type VPPClient
- type VPPError
- type VPPLicense
- type VPPUser
Constants ¶
const ( RegStatusRegistered string = "Registered" RegStatusAssociated = "Associated" RegStatusRetired = "Retired" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssetsService ¶
type AssetsService interface {
GetAssets(includeLicenseCounts bool) ([]VPPAssetAssignment, error)
}
AssetsService describes an interface that is capable of reporting on VPP assets and their license counts.
type BatchRequest ¶
type BatchRequest struct { BatchToken string `json:"batchToken,omitempty"` SinceModifiedToken string `json:"sinceModifiedToken,omitempty"` }
BatchRequestOpts is a structure that defines options available when fetching objects in batches (users/licenses)
func (*BatchRequest) HasNext ¶
func (br *BatchRequest) HasNext() bool
type ClientContext ¶
type ClientContext struct { Hostname string `json:"hostname,omitempty"` GUID string `json:"guid,omitempty"` }
ClientContext represents the information about the current MDM which is stored with the VPP service to ensure that two MDM services are not managing the same VPP account.
func NewClientContext ¶
func NewClientContext(hostname string) *ClientContext
type ConfigService ¶
type ConfigService interface { ServiceConfig() (*ServiceConfig, error) ClientContext() (string, error) UpdateClientContext(clientContext *ClientContext) (string, error) }
type GetLicensesOption ¶
type GetLicensesOption func(*getLicensesRequestOpts) error
GetLicensesOption describes the signature of the closure returned by a function adding an argument to GetLicenses
type GetUsersOption ¶
type GetUsersOption func(*getUsersRequestOpts) error
GetUsersOption describes the signature of the closure returned by a function adding an argument to GetUsers
func IncludeRetired ¶
func IncludeRetired(include bool) GetUsersOption
IncludeRetired is an argument given to GetUsers to include users that have been retired. Retiring a user disassociates a VPP user ID from its iTunes account and releases all revocable licenses.
type LicenseAssociation ¶
type LicenseAssociation struct { ClientUserIDStr string `json:"clientUserIdStr,omitempty"` LicenseIDStr string `json:"licenseIdStr,omitempty"` SerialNumber string `json:"serialNumber,omitempty"` *VPPError }
LicenseAssociation describes an association between a (VPP user OR device serial) and a license
type LicensesService ¶
type LicensesService interface { GetLicenses(batch *BatchRequest, opts ...GetLicensesOption) ([]VPPLicense, error) AssociateLicense(user *VPPUser, license *VPPLicense) error DisassociateLicense(user *VPPUser, license *VPPLicense) error }
LicensesService describes an interface that can manage VPP licenses
type MetadataService ¶
type MetadataService interface { }
type PricingParam ¶
type PricingParam string
const ( PricingParamStd PricingParam = "STDQ" // Standard Quality PricingParamPlus = "PLUS" // High Quality (Books only) )
type SToken ¶
type SToken struct { Token string `json:"token"` ExpDateStr string `json:"expDate"` OrgName string `json:"orgName"` }
func DecodeSToken ¶
func (*SToken) Base64String ¶
type ServiceConfig ¶
type ServiceConfig struct { InvitationEmailURL string `json:"invitationEmailUrl"` RegisterUserSrvURL string `json:"registerUserSrvUrl"` EditUserSrvURL string `json:"editUserSrvUrl"` GetUserSrvURL string `json:"getUserSrvUrl"` RetireUserSrvURL string `json:"retireUserSrvUrl"` GetUsersSrvURL string `json:"getUsersSrvUrl"` GetLicensesSrvURL string `json:"getLicensesSrvUrl"` AssociateLicenseSrvURL string `json:"associateLicenseSrvUrl"` DisassociateLicenseSrvURL string `json:"disassociateLicenseSrvUrl"` ClientConfigSrvURL string `json:"clientConfigSrvUrl"` ErrorCodes []VPPError `json:"errorCodes"` GetVPPAssetsSrvURL string `json:"getVPPAssetsSrvUrl"` InvitationEmailUrl string `json:"invitationEmailUrl"` ManageVPPLicensesByAdamIdSrvURL string `json:"manageVPPLicensesByAdamIdSrvUrl"` MaxBatchAssociateLicenseCount int `json:"maxBatchAssociateLicenseCount"` MaxBatchDisassociateLicenseCount int `json:"maxBatchDisassociateLicenseCount"` Status int `json:"status"` VPPWebsiteUrl string `json:"vppWebsiteUrl"` }
type UsersService ¶
type UsersService interface { RegisterUser(user *VPPUser) (*VPPUser, error) GetUser(*VPPUser) error GetUsers(batch *BatchRequest, opts ...GetUsersOption) ([]VPPUser, error) RetireUser(user *VPPUser) error EditUser(user *VPPUser) error }
UsersService interface describes the methods available as part of the VPP user management API.
type VPPAsset ¶
type VPPAsset struct { AdamID string `json:"adamIdStr,omitempty"` ProductTypeID int `json:"productTypeId,omitempty"` PricingParam PricingParam `json:"pricingParam,omitempty"` ProductTypeName string `json:"productTypeName"` }
VPPAsset represents a single licenseable item
type VPPAssetAssignment ¶
type VPPAssetAssignment struct { AdamIdStr string `json:"adamIdStr"` AssignedCount int `json:"assignedCount"` AvailableCount int `json:"availableCount"` DeviceAssignable bool `json:"deviceAssignable"` IsIrrevocable bool `json:"isIrrevocable"` PricingParam PricingParam `json:"pricingParam"` ProductTypeId int `json:"productTypeId"` ProductTypeName string `json:"productTypeName"` RetiredCount int `json:"retiredCount"` TotalCount int `json:"totalCount"` }
VPPAssetAssignment represents a single asset/product and its currently available/assigned licenses totals.
type VPPClient ¶
type VPPClient interface { NewRequest(method, urlStr string, body interface{}) (*http.Request, error) Do(req *http.Request, into interface{}) error AssetsService ConfigService LicensesService MetadataService UsersService }
func NewVPPClient ¶
type VPPError ¶
type VPPLicense ¶
type VPPLicense struct { LicenseID string `json:"licenseIdStr,omitempty"` IsIrrevocable bool `json:"isIrrevocable"` *VPPAsset *VPPUser }
VPPLicense describes a licensed product (VPPAsset) and its (optional) association with a VPP User.
type VPPUser ¶
type VPPUser struct { UserID int `json:"userId,omitempty"` Email string `json:"email,omitempty"` Status string `json:"status,omitempty"` InviteURL string `json:"inviteUrl,omitempty"` InviteCode string `json:"inviteCode,omitempty"` ClientUserIdStr string `json:"clientUserIdStr,omitempty"` ITSIdHash string `json:"itsIdHash,omitempty"` // empty if no iTunes account has been associated }
VPPUser describes the attributes of a VPP user. In most cases, ClientUserIdStr should be used over UserID