Documentation
¶
Overview ¶
Package ddmreport provides typed access to Jamf Platform ddmreport API endpoints.
Index ¶
- Variables
- func PrivilegesFor(method string) (jamfplatform.MethodPrivileges, bool)
- type ApiErrorDto
- type Client
- func (c *Client) GetDeviceChannels(ctx context.Context, deviceID string) (*DeviceChannelsDto, error)
- func (c *Client) GetDeviceDeclarationReportFiltered(ctx context.Context, deviceID string, filter string, sort []string) ([]FilteredResultDto, error)
- func (c *Client) ListDeclarationReportClientsFiltered(ctx context.Context, declarationIdentifier string, filter string, ...) ([]FilteredResultDto, error)
- type DeviceChannelsDto
- type ErrorDto
- type FilteredDeclarationReportDto
- type FilteredDeviceReportDto
- type FilteredResultDto
- type FilteredResultDtoStatus
- type FilteredResultDtoType
- type FilteredResultDtoValidityState
- type StatusReportDeclarationReasonDetailDto
- type StatusReportDeclarationReasonDto
Constants ¶
This section is empty.
Variables ¶
var Privileges = map[string]jamfplatform.MethodPrivileges{ "GetDeviceChannels": {Method: "GetDeviceChannels", HTTPMethod: "GET", Path: "/v1/devices/{deviceId}/channels", Scopes: []jamfplatform.ScopeKind{jamfplatform.ScopeEnvironment}, ScopesSource: "spec", Scoped: []string{"declarations:read"}, Legacy: nil, Source: "spec"}, "GetDeviceDeclarationReportFiltered": {Method: "GetDeviceDeclarationReportFiltered", HTTPMethod: "GET", Path: "/v1/devices/{deviceId}/declarations", Scopes: []jamfplatform.ScopeKind{jamfplatform.ScopeEnvironment}, ScopesSource: "spec", Scoped: []string{"declarations:read"}, Legacy: nil, Source: "spec"}, "ListDeclarationReportClientsFiltered": {Method: "ListDeclarationReportClientsFiltered", HTTPMethod: "GET", Path: "/v1/declarations/{declarationIdentifier}/devices", Scopes: []jamfplatform.ScopeKind{jamfplatform.ScopeEnvironment}, ScopesSource: "spec", Scoped: []string{"declarations:read"}, Legacy: nil, Source: "spec"}, }
Privileges maps each ddmreport SDK method name to the Jamf API privileges it requires, sourced from the x-required-privileges vendor extensions in the Jamf OpenAPI specs. Identifiers are GA capability permissions in {capability}:{action} form and a multi-entry Scoped slice means all of them are required.
Source names where each entry's Scoped set came from: "spec" for the operation's own x-required-privileges, "gateway-policy" for one the published spec omits and this SDK supplies from the gateway's authorization policy, and "" when Scoped is empty. An empty Scoped slice means nothing declares a privilege for the endpoint, which is NOT the same as none being required — see jamfplatform.MethodPrivileges. Do not render it as "no permission needed".
Scopes lists the scope kinds each endpoint accepts. It is an alternatives set: a client carries one scope, so a consumer needs a credential matching one of the listed kinds. ScopesSource names where the set came from — "spec" for the spec root's own x-scope-types, "config-override" for one this SDK supplies because the published spec understates what the gateway serves or declares no extension at all. A spec-sourced set is what the spec declares, which for the Platform APIs is currently stricter than the gateway — see jamfplatform.MethodPrivileges.
Synthetic Resolve<X>ByName / Apply<X> methods are not present; document the privileges of the operations they call instead.
Functions ¶
func PrivilegesFor ¶
func PrivilegesFor(method string) (jamfplatform.MethodPrivileges, bool)
PrivilegesFor returns the privilege metadata for the named SDK method and true when the method is present in the registry, or the zero value and false otherwise.
Types ¶
type ApiErrorDto ¶
type ApiErrorDto struct {
Errors []ErrorDto `json:"errors"`
// HTTP status of the response.
HttpStatus int `json:"httpStatus"`
// Trace ID.
TraceID string `json:"traceId"`
}
ApiErrorDto represents a api error dto.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides typed methods for ddmreport operations.
func New ¶
func New(base *jamfplatform.Client) *Client
New creates a ddmreport client that shares the authenticated transport of the given root client.
func (*Client) GetDeviceChannels ¶
func (c *Client) GetDeviceChannels(ctx context.Context, deviceID string) (*DeviceChannelsDto, error)
GetDeviceChannels get device channels.
Required privileges: declarations:read.
Parameters:
- deviceID: The platform deviceId.
func (*Client) GetDeviceDeclarationReportFiltered ¶
func (c *Client) GetDeviceDeclarationReportFiltered(ctx context.Context, deviceID string, filter string, sort []string) ([]FilteredResultDto, error)
GetDeviceDeclarationReportFiltered get filtered device report declarations.
Required privileges: declarations:read.
Parameters:
- deviceID: The platform deviceId.
- filter: RSQL filter expression. Allowed fields: declarationIdentifier, active, validityState, declarationType, dateUpdated, channel.
- sort: Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
func (*Client) ListDeclarationReportClientsFiltered ¶
func (c *Client) ListDeclarationReportClientsFiltered(ctx context.Context, declarationIdentifier string, filter string, sort []string) ([]FilteredResultDto, error)
ListDeclarationReportClientsFiltered get filtered declaration report devices.
Required privileges: declarations:read.
Parameters:
- declarationIdentifier: The declarationIdentifier present on a status report.
- filter: RSQL filter expression. Allowed fields: deviceId, channel, lastReportTime, active, validityState, declarationType, dateUpdated.
- sort: Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
type DeviceChannelsDto ¶
type DeviceChannelsDto struct {
// The channels associated with the device.
Channels []string `json:"channels"`
// The platform deviceId.
DeviceID string `json:"deviceId"`
}
DeviceChannelsDto represents a device channels dto.
type ErrorDto ¶
type ErrorDto struct {
// Error-specific code that can be used to identify localization string, etc.
Code string `json:"code"`
// A general description of error for troubleshooting/debugging. Generally this text should not be
// displayed to a user; instead refer to errorCode and its localized text.
Description string `json:"description"`
// Name of the field that caused the error.
Field string `json:"field"`
// id of object with error.
ID *string `json:"id,omitempty"`
}
ErrorDto represents a error dto.
type FilteredDeclarationReportDto ¶
type FilteredDeclarationReportDto struct {
// The declaration identifier.
DeclarationIdentifier string `json:"declarationIdentifier"`
// The devices associated with the declaration that meet the required filters.
Results []FilteredResultDto `json:"results"`
// The total number of devices reported for the declaration that meet the required filters.
TotalCount int64 `json:"totalCount"`
}
FilteredDeclarationReportDto represents a filtered declaration report dto.
type FilteredDeviceReportDto ¶
type FilteredDeviceReportDto struct {
// The platform deviceId.
DeviceID string `json:"deviceId"`
// The declarations associated with any channel on the device that meet the required filters.
Results []FilteredResultDto `json:"results"`
// The total number of declarations reported for the device that meet the required filters.
TotalCount int64 `json:"totalCount"`
}
FilteredDeviceReportDto represents a filtered device report dto.
type FilteredResultDto ¶
type FilteredResultDto struct {
// The active state of the declaration.
Active bool `json:"active"`
// The channel of the client from which the report is sent.
Channel string `json:"channel"`
// The timestamp when this declaration status was last updated for the device.
DateUpdated *time.Time `json:"dateUpdated,omitempty"`
// The identifier of the declaration.
DeclarationIdentifier string `json:"declarationIdentifier"`
// The platform deviceId.
DeviceID string `json:"deviceId"`
// The timestamp of the device's last status report.
LastReportTime *time.Time `json:"lastReportTime,omitempty"`
// Reasons associated with the declaration, if any.
Reasons []StatusReportDeclarationReasonDto `json:"reasons"`
// The server token for the declaration.
ServerToken string `json:"serverToken"`
// The installation status of the declaration.
// Allowed values: see the FilteredResultDtoStatus constants.
Status string `json:"status"`
// The type of the declaration.
// Allowed values: see the FilteredResultDtoType constants.
Type string `json:"type"`
// The validity state of the declaration.
// Allowed values: see the FilteredResultDtoValidityState constants.
ValidityState string `json:"validityState"`
}
FilteredResultDto represents a filtered result dto.
type FilteredResultDtoStatus ¶
type FilteredResultDtoStatus = string
FilteredResultDtoStatus is the set of values accepted by FilteredResultDto.Status.
const ( FilteredResultDtoStatusPending FilteredResultDtoStatus = "PENDING" FilteredResultDtoStatusSuccessful FilteredResultDtoStatus = "SUCCESSFUL" FilteredResultDtoStatusAwaitingSync FilteredResultDtoStatus = "AWAITING_SYNC" FilteredResultDtoStatusUnsuccessful FilteredResultDtoStatus = "UNSUCCESSFUL" FilteredResultDtoStatusUnknown FilteredResultDtoStatus = "UNKNOWN" )
FilteredResultDtoStatus values accepted by the Jamf API. The alias above is a string, so these constants pass to any parameter or field declared as a plain string.
func FilteredResultDtoStatusValues ¶
func FilteredResultDtoStatusValues() []FilteredResultDtoStatus
FilteredResultDtoStatusValues returns every value the Jamf API accepts for FilteredResultDtoStatus, in the order the spec declares them. Returns a fresh slice per call, so no caller can corrupt the set for the rest of the process — which a package level var would allow. Suits attribute validation (Terraform's stringvalidator.OneOf, say) and anything that needs to enumerate the set rather than name one member.
type FilteredResultDtoType ¶
type FilteredResultDtoType = string
FilteredResultDtoType is the set of values accepted by FilteredResultDto.Type.
const ( FilteredResultDtoTypeAsset FilteredResultDtoType = "ASSET" FilteredResultDtoTypeManagement FilteredResultDtoType = "MANAGEMENT" FilteredResultDtoTypeConfiguration FilteredResultDtoType = "CONFIGURATION" FilteredResultDtoTypeActivation FilteredResultDtoType = "ACTIVATION" FilteredResultDtoTypeUnknown FilteredResultDtoType = "UNKNOWN" )
FilteredResultDtoType values accepted by the Jamf API. The alias above is a string, so these constants pass to any parameter or field declared as a plain string.
func FilteredResultDtoTypeValues ¶
func FilteredResultDtoTypeValues() []FilteredResultDtoType
FilteredResultDtoTypeValues returns every value the Jamf API accepts for FilteredResultDtoType, in the order the spec declares them. Returns a fresh slice per call, so no caller can corrupt the set for the rest of the process — which a package level var would allow. Suits attribute validation (Terraform's stringvalidator.OneOf, say) and anything that needs to enumerate the set rather than name one member.
type FilteredResultDtoValidityState ¶
type FilteredResultDtoValidityState = string
FilteredResultDtoValidityState is the set of values accepted by FilteredResultDto.ValidityState.
const ( FilteredResultDtoValidityStateValid FilteredResultDtoValidityState = "VALID" FilteredResultDtoValidityStateInvalid FilteredResultDtoValidityState = "INVALID" FilteredResultDtoValidityStateUnknown FilteredResultDtoValidityState = "UNKNOWN" )
FilteredResultDtoValidityState values accepted by the Jamf API. The alias above is a string, so these constants pass to any parameter or field declared as a plain string.
func FilteredResultDtoValidityStateValues ¶
func FilteredResultDtoValidityStateValues() []FilteredResultDtoValidityState
FilteredResultDtoValidityStateValues returns every value the Jamf API accepts for FilteredResultDtoValidityState, in the order the spec declares them. Returns a fresh slice per call, so no caller can corrupt the set for the rest of the process — which a package level var would allow. Suits attribute validation (Terraform's stringvalidator.OneOf, say) and anything that needs to enumerate the set rather than name one member.
type StatusReportDeclarationReasonDetailDto ¶
type StatusReportDeclarationReasonDetailDto struct {
// The description of the detail key.
Description string `json:"description"`
// The reason detail key.
Key string `json:"key"`
}
StatusReportDeclarationReasonDetailDto represents a status report declaration reason detail dto.
type StatusReportDeclarationReasonDto ¶
type StatusReportDeclarationReasonDto struct {
// The reason code.
Code string `json:"code"`
// The description of the reason.
Description string `json:"description"`
// Details associated with the reason, if any.
Details []StatusReportDeclarationReasonDetailDto `json:"details"`
}
StatusReportDeclarationReasonDto represents a status report declaration reason dto.