Documentation
¶
Index ¶
- Variables
- func GetDefaultClient(options *GraphClientOptions, middleware ...khttp.Middleware) *nethttp.Client
- func GetDefaultMiddlewaresWithOptions(options *GraphClientOptions) []khttp.Middleware
- type GraphClientOptions
- type GraphRequestAdapterBase
- func NewGraphRequestAdapterBase(authenticationProvider absauth.AuthenticationProvider, ...) (*GraphRequestAdapterBase, error)
- func NewGraphRequestAdapterBaseWithParseNodeFactory(authenticationProvider absauth.AuthenticationProvider, ...) (*GraphRequestAdapterBase, error)
- func NewGraphRequestAdapterBaseWithParseNodeFactoryAndSerializationWriterFactory(authenticationProvider absauth.AuthenticationProvider, ...) (*GraphRequestAdapterBase, error)
- func NewGraphRequestAdapterBaseWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient(authenticationProvider absauth.AuthenticationProvider, ...) (*GraphRequestAdapterBase, error)
- type GraphTelemetryHandler
- type PageIterator
- type PageResult
Constants ¶
This section is empty.
Variables ¶
var CoreVersion = "0.25.0"
Functions ¶
func GetDefaultClient ¶
func GetDefaultClient(options *GraphClientOptions, middleware ...khttp.Middleware) *nethttp.Client
GetDefaultClient creates a new http client with a preconfigured middleware pipeline
func GetDefaultMiddlewaresWithOptions ¶
func GetDefaultMiddlewaresWithOptions(options *GraphClientOptions) []khttp.Middleware
GetDefaultMiddlewaresWithOptions creates a default slice of middleware for the Graph Client.
Types ¶
type GraphClientOptions ¶
GraphClientOptions represents a combination of GraphServiceVersion and GraphServiceLibraryVersion
GraphServiceVersion is version of the targeted service. GraphServiceLibraryVersion is the version of the service library
type GraphRequestAdapterBase ¶
type GraphRequestAdapterBase struct {
khttp.NetHttpRequestAdapter
}
GraphRequestAdapterBase is the core service used by GraphServiceClient to make requests to Microsoft Graph.
func NewGraphRequestAdapterBase ¶
func NewGraphRequestAdapterBase(authenticationProvider absauth.AuthenticationProvider, clientOptions GraphClientOptions) (*GraphRequestAdapterBase, error)
NewGraphRequestAdapterBase creates a new GraphRequestAdapterBase with the given parameters
func NewGraphRequestAdapterBaseWithParseNodeFactory ¶
func NewGraphRequestAdapterBaseWithParseNodeFactory(authenticationProvider absauth.AuthenticationProvider, clientOptions GraphClientOptions, parseNodeFactory absser.ParseNodeFactory) (*GraphRequestAdapterBase, error)
NewGraphRequestAdapterBaseWithParseNodeFactory creates a new GraphRequestAdapterBase with the given parameters
func NewGraphRequestAdapterBaseWithParseNodeFactoryAndSerializationWriterFactory ¶
func NewGraphRequestAdapterBaseWithParseNodeFactoryAndSerializationWriterFactory(authenticationProvider absauth.AuthenticationProvider, clientOptions GraphClientOptions, parseNodeFactory absser.ParseNodeFactory, serializationWriterFactory absser.SerializationWriterFactory) (*GraphRequestAdapterBase, error)
NewGraphRequestAdapterBaseWithParseNodeFactoryAndSerializationWriterFactory creates a new GraphRequestAdapterBase with the given parameters
func NewGraphRequestAdapterBaseWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient ¶
func NewGraphRequestAdapterBaseWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient(authenticationProvider absauth.AuthenticationProvider, clientOptions GraphClientOptions, parseNodeFactory absser.ParseNodeFactory, serializationWriterFactory absser.SerializationWriterFactory, httpClient *nethttp.Client) (*GraphRequestAdapterBase, error)
NewGraphRequestAdapterBaseWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient creates a new GraphRequestAdapterBase with the given parameters
type GraphTelemetryHandler ¶
type GraphTelemetryHandler struct {
// contains filtered or unexported fields
}
GraphTelemetryHandler is a middleware handler that adds telemetry headers to requests.
func NewGraphTelemetryHandler ¶
func NewGraphTelemetryHandler(options *GraphClientOptions) *GraphTelemetryHandler
NewGraphTelemetryHandler creates a new GraphTelemetryHandler.
type PageIterator ¶ added in v0.0.6
type PageIterator struct {
// contains filtered or unexported fields
}
PageIterator represents an iterator object that can be used to get subsequent pages of a collection.
func NewPageIterator ¶ added in v0.0.6
func NewPageIterator(res interface{}, reqAdapter abstractions.RequestAdapter, constructorFunc serialization.ParsableFactory) (*PageIterator, error)
NewPageIterator creates an iterator instance
It has three parameters. res is the graph response from the initial request and represents the first page. reqAdapter is used for getting the next page and constructorFunc is used for serializing next page's response to the specified type.
func (*PageIterator) Iterate ¶ added in v0.0.6
func (pI *PageIterator) Iterate(callback func(pageItem interface{}) bool) error
Iterate traverses all pages and enumerates all items in the current page and returns an error if something goes wrong.
Iterate receives a callback function which is called with each item in the current page as an argument. The callback function returns a boolean. To traverse and enumerate all pages always return true and to pause traversal and enumeration return false from the callback.
Example
pageIterator, err := NewPageIterator(resp, reqAdapter, parsableFactory) callbackFunc := func (pageItem interface{}) bool { fmt.Println(pageitem.GetDisplayName()) return true } err := pageIterator.Iterate(callbackFunc)
func (*PageIterator) SetHeaders ¶ added in v0.0.6
func (pI *PageIterator) SetHeaders(headers map[string]string)
SetHeaders provides headers for requests made to get subsequent pages
Headers in the initial request -- request to get the first page -- are not included in subsequent page requests.
func (*PageIterator) SetReqOptions ¶ added in v0.0.6
func (pI *PageIterator) SetReqOptions(reqOptions []abstractions.RequestOption)
SetReqOptions provides configuration for handlers during requests for subsequent pages
type PageResult ¶ added in v0.0.6
type PageResult struct {
// contains filtered or unexported fields
}
PageResult represents a page object built from a graph response object