-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathexchange_mailboxes_item_export_items_request_builder.go
More file actions
105 lines (102 loc) · 8.04 KB
/
Copy pathexchange_mailboxes_item_export_items_request_builder.go
File metadata and controls
105 lines (102 loc) · 8.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// Code generated by Microsoft Kiota - DO NOT EDIT.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
package admin
import (
"context"
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors"
)
// ExchangeMailboxesItemExportItemsRequestBuilder provides operations to call the exportItems method.
type ExchangeMailboxesItemExportItemsRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}
// ExchangeMailboxesItemExportItemsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options.
type ExchangeMailboxesItemExportItemsRequestBuilderPostRequestConfiguration struct {
// Request headers
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders
// Request options
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption
}
// NewExchangeMailboxesItemExportItemsRequestBuilderInternal instantiates a new ExchangeMailboxesItemExportItemsRequestBuilder and sets the default values.
func NewExchangeMailboxesItemExportItemsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ExchangeMailboxesItemExportItemsRequestBuilder) {
m := &ExchangeMailboxesItemExportItemsRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/exchange/mailboxes/{mailbox%2Did}/exportItems", pathParameters),
}
return m
}
// NewExchangeMailboxesItemExportItemsRequestBuilder instantiates a new ExchangeMailboxesItemExportItemsRequestBuilder and sets the default values.
func NewExchangeMailboxesItemExportItemsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ExchangeMailboxesItemExportItemsRequestBuilder) {
urlParams := make(map[string]string)
urlParams["request-raw-url"] = rawUrl
return NewExchangeMailboxesItemExportItemsRequestBuilderInternal(urlParams, requestAdapter)
}
// Post export Exchange mailboxItem objects in full fidelity. This API exports each item as an opaque stream. The data stream isn't intended for parsing, but can be used to import an item back into an Exchange mailbox. For more information, see Overview of the mailbox import and export APIs in Microsoft Graph. You can export up to 20 items in a single export request.
// Deprecated: This method is obsolete. Use PostAsExportItemsPostResponse instead.
// returns a ExchangeMailboxesItemExportItemsResponseable when successful
// returns a ODataError error when the service returns a 4XX or 5XX status code
// [Find more info here]
//
// [Find more info here]: https://learn.microsoft.com/graph/api/mailbox-exportitems?view=graph-rest-beta
func (m *ExchangeMailboxesItemExportItemsRequestBuilder) Post(ctx context.Context, body ExchangeMailboxesItemExportItemsPostRequestBodyable, requestConfiguration *ExchangeMailboxesItemExportItemsRequestBuilderPostRequestConfiguration)(ExchangeMailboxesItemExportItemsResponseable, error) {
requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration);
if err != nil {
return nil, err
}
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {
"XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,
}
res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateExchangeMailboxesItemExportItemsResponseFromDiscriminatorValue, errorMapping)
if err != nil {
return nil, err
}
if res == nil {
return nil, nil
}
return res.(ExchangeMailboxesItemExportItemsResponseable), nil
}
// PostAsExportItemsPostResponse export Exchange mailboxItem objects in full fidelity. This API exports each item as an opaque stream. The data stream isn't intended for parsing, but can be used to import an item back into an Exchange mailbox. For more information, see Overview of the mailbox import and export APIs in Microsoft Graph. You can export up to 20 items in a single export request.
// Deprecated: Private preview for Import Export APIs as of 2021-08/PrivatePreview:importExport on 2021-08-19 and will be removed 2024-06-30
// returns a ExchangeMailboxesItemExportItemsPostResponseable when successful
// returns a ODataError error when the service returns a 4XX or 5XX status code
// [Find more info here]
//
// [Find more info here]: https://learn.microsoft.com/graph/api/mailbox-exportitems?view=graph-rest-beta
func (m *ExchangeMailboxesItemExportItemsRequestBuilder) PostAsExportItemsPostResponse(ctx context.Context, body ExchangeMailboxesItemExportItemsPostRequestBodyable, requestConfiguration *ExchangeMailboxesItemExportItemsRequestBuilderPostRequestConfiguration)(ExchangeMailboxesItemExportItemsPostResponseable, error) {
requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration);
if err != nil {
return nil, err
}
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {
"XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,
}
res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateExchangeMailboxesItemExportItemsPostResponseFromDiscriminatorValue, errorMapping)
if err != nil {
return nil, err
}
if res == nil {
return nil, nil
}
return res.(ExchangeMailboxesItemExportItemsPostResponseable), nil
}
// ToPostRequestInformation export Exchange mailboxItem objects in full fidelity. This API exports each item as an opaque stream. The data stream isn't intended for parsing, but can be used to import an item back into an Exchange mailbox. For more information, see Overview of the mailbox import and export APIs in Microsoft Graph. You can export up to 20 items in a single export request.
// Deprecated: Private preview for Import Export APIs as of 2021-08/PrivatePreview:importExport on 2021-08-19 and will be removed 2024-06-30
// returns a *RequestInformation when successful
func (m *ExchangeMailboxesItemExportItemsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ExchangeMailboxesItemExportItemsPostRequestBodyable, requestConfiguration *ExchangeMailboxesItemExportItemsRequestBuilderPostRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters)
if requestConfiguration != nil {
requestInfo.Headers.AddAll(requestConfiguration.Headers)
requestInfo.AddRequestOptions(requestConfiguration.Options)
}
requestInfo.Headers.TryAdd("Accept", "application/json")
err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body)
if err != nil {
return nil, err
}
return requestInfo, nil
}
// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
// Deprecated: Private preview for Import Export APIs as of 2021-08/PrivatePreview:importExport on 2021-08-19 and will be removed 2024-06-30
// returns a *ExchangeMailboxesItemExportItemsRequestBuilder when successful
func (m *ExchangeMailboxesItemExportItemsRequestBuilder) WithUrl(rawUrl string)(*ExchangeMailboxesItemExportItemsRequestBuilder) {
return NewExchangeMailboxesItemExportItemsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter);
}