Documentation
¶
Overview ¶
Package apidocs provides search functionality over a pre-processed index of Microsoft Graph API documentation, including per-endpoint permissions, query parameters, and per-resource property details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EndpointDoc ¶
type EndpointDoc struct {
Path string `json:"path"`
Method string `json:"method"`
Permissions Permissions `json:"permissions"`
QueryParams []string `json:"queryParams,omitempty"`
RequiredHeaders []string `json:"requiredHeaders,omitempty"`
DefaultProperties []string `json:"defaultProperties,omitempty"`
Notes []string `json:"notes,omitempty"`
}
EndpointDoc represents a single API endpoint with documentation details.
type EndpointResult ¶
type EndpointResult struct {
EndpointDoc
MatchReason string `json:"matchReason"`
}
EndpointResult wraps an endpoint doc with a match reason.
type Index ¶
type Index struct {
Version string `json:"version"`
Generated string `json:"generated"`
EndpointCount int `json:"endpointCount"`
ResourceCount int `json:"resourceCount"`
Endpoints []EndpointDoc `json:"endpoints"`
Resources []ResourceDoc `json:"resources"`
}
Index holds the full searchable API docs index.
func (*Index) SearchEndpoints ¶
func (idx *Index) SearchEndpoints(endpoint, method, query string, limit int) []EndpointResult
SearchEndpoints finds endpoint docs matching the given criteria.
func (*Index) SearchResources ¶
func (idx *Index) SearchResources(resource, query string, limit int) []ResourceResult
SearchResources finds resource docs matching the given criteria. Results are sorted: exact name match first, then prefix matches, then substring matches.
type Permissions ¶
type Permissions struct {
DelegatedWork []string `json:"delegatedWork,omitempty"`
DelegatedPersonal []string `json:"delegatedPersonal,omitempty"`
Application []string `json:"application,omitempty"`
}
Permissions holds the required permission scopes split by auth type.
type PropertyDoc ¶
type PropertyDoc struct {
Name string `json:"name"`
Type string `json:"type"`
Filter []string `json:"filter,omitempty"`
Default bool `json:"default,omitempty"`
Notes string `json:"notes,omitempty"`
}
PropertyDoc describes a single property of a resource.
type ResourceDoc ¶
type ResourceDoc struct {
Name string `json:"name"`
Properties []PropertyDoc `json:"properties,omitempty"`
}
ResourceDoc represents a resource type with its properties.
type ResourceResult ¶
type ResourceResult struct {
ResourceDoc
MatchReason string `json:"matchReason"`
}
ResourceResult wraps a resource doc with a match reason.