|
| 1 | +package admin |
| 2 | + |
| 3 | +import ( |
| 4 | + "context" |
| 5 | + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" |
| 6 | + iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242 "github.com/microsoftgraph/msgraph-sdk-go/models" |
| 7 | + ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" |
| 8 | +) |
| 9 | + |
| 10 | +// PeopleItemInsightsRequestBuilder provides operations to manage the itemInsights property of the microsoft.graph.peopleAdminSettings entity. |
| 11 | +type PeopleItemInsightsRequestBuilder struct { |
| 12 | + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder |
| 13 | +} |
| 14 | +// PeopleItemInsightsRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. |
| 15 | +type PeopleItemInsightsRequestBuilderDeleteRequestConfiguration struct { |
| 16 | + // Request headers |
| 17 | + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders |
| 18 | + // Request options |
| 19 | + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption |
| 20 | +} |
| 21 | +// PeopleItemInsightsRequestBuilderGetQueryParameters get the properties of an insightsSettings object to display or return item insights in an organization. To learn how to customize the privacy of item insights in an organization, see Customize item insights privacy in Microsoft Graph. |
| 22 | +type PeopleItemInsightsRequestBuilderGetQueryParameters struct { |
| 23 | + // Expand related entities |
| 24 | + Expand []string `uriparametername:"%24expand"` |
| 25 | + // Select properties to be returned |
| 26 | + Select []string `uriparametername:"%24select"` |
| 27 | +} |
| 28 | +// PeopleItemInsightsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. |
| 29 | +type PeopleItemInsightsRequestBuilderGetRequestConfiguration struct { |
| 30 | + // Request headers |
| 31 | + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders |
| 32 | + // Request options |
| 33 | + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption |
| 34 | + // Request query parameters |
| 35 | + QueryParameters *PeopleItemInsightsRequestBuilderGetQueryParameters |
| 36 | +} |
| 37 | +// PeopleItemInsightsRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. |
| 38 | +type PeopleItemInsightsRequestBuilderPatchRequestConfiguration struct { |
| 39 | + // Request headers |
| 40 | + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders |
| 41 | + // Request options |
| 42 | + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption |
| 43 | +} |
| 44 | +// NewPeopleItemInsightsRequestBuilderInternal instantiates a new PeopleItemInsightsRequestBuilder and sets the default values. |
| 45 | +func NewPeopleItemInsightsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PeopleItemInsightsRequestBuilder) { |
| 46 | + m := &PeopleItemInsightsRequestBuilder{ |
| 47 | + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/people/itemInsights{?%24expand,%24select}", pathParameters), |
| 48 | + } |
| 49 | + return m |
| 50 | +} |
| 51 | +// NewPeopleItemInsightsRequestBuilder instantiates a new PeopleItemInsightsRequestBuilder and sets the default values. |
| 52 | +func NewPeopleItemInsightsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PeopleItemInsightsRequestBuilder) { |
| 53 | + urlParams := make(map[string]string) |
| 54 | + urlParams["request-raw-url"] = rawUrl |
| 55 | + return NewPeopleItemInsightsRequestBuilderInternal(urlParams, requestAdapter) |
| 56 | +} |
| 57 | +// Delete delete navigation property itemInsights for admin |
| 58 | +// returns a ODataError error when the service returns a 4XX or 5XX status code |
| 59 | +func (m *PeopleItemInsightsRequestBuilder) Delete(ctx context.Context, requestConfiguration *PeopleItemInsightsRequestBuilderDeleteRequestConfiguration)(error) { |
| 60 | + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); |
| 61 | + if err != nil { |
| 62 | + return err |
| 63 | + } |
| 64 | + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { |
| 65 | + "XXX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue, |
| 66 | + } |
| 67 | + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) |
| 68 | + if err != nil { |
| 69 | + return err |
| 70 | + } |
| 71 | + return nil |
| 72 | +} |
| 73 | +// Get get the properties of an insightsSettings object to display or return item insights in an organization. To learn how to customize the privacy of item insights in an organization, see Customize item insights privacy in Microsoft Graph. |
| 74 | +// returns a InsightsSettingsable when successful |
| 75 | +// returns a ODataError error when the service returns a 4XX or 5XX status code |
| 76 | +// [Find more info here] |
| 77 | +// |
| 78 | +// [Find more info here]: https://learn.microsoft.com/graph/api/peopleadminsettings-list-iteminsights?view=graph-rest-1.0 |
| 79 | +func (m *PeopleItemInsightsRequestBuilder) Get(ctx context.Context, requestConfiguration *PeopleItemInsightsRequestBuilderGetRequestConfiguration)(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.InsightsSettingsable, error) { |
| 80 | + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); |
| 81 | + if err != nil { |
| 82 | + return nil, err |
| 83 | + } |
| 84 | + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { |
| 85 | + "XXX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue, |
| 86 | + } |
| 87 | + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.CreateInsightsSettingsFromDiscriminatorValue, errorMapping) |
| 88 | + if err != nil { |
| 89 | + return nil, err |
| 90 | + } |
| 91 | + if res == nil { |
| 92 | + return nil, nil |
| 93 | + } |
| 94 | + return res.(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.InsightsSettingsable), nil |
| 95 | +} |
| 96 | +// Patch update privacy settings to display or return the specified type of insights in an organization. Currently, itemInsights is the only supported type of settings. To learn more about customizing insights privacy for your organization, see Customize item insights privacy in Microsoft Graph. |
| 97 | +// returns a InsightsSettingsable when successful |
| 98 | +// returns a ODataError error when the service returns a 4XX or 5XX status code |
| 99 | +// [Find more info here] |
| 100 | +// |
| 101 | +// [Find more info here]: https://learn.microsoft.com/graph/api/insightssettings-update?view=graph-rest-1.0 |
| 102 | +func (m *PeopleItemInsightsRequestBuilder) Patch(ctx context.Context, body iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.InsightsSettingsable, requestConfiguration *PeopleItemInsightsRequestBuilderPatchRequestConfiguration)(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.InsightsSettingsable, error) { |
| 103 | + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); |
| 104 | + if err != nil { |
| 105 | + return nil, err |
| 106 | + } |
| 107 | + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { |
| 108 | + "XXX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue, |
| 109 | + } |
| 110 | + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.CreateInsightsSettingsFromDiscriminatorValue, errorMapping) |
| 111 | + if err != nil { |
| 112 | + return nil, err |
| 113 | + } |
| 114 | + if res == nil { |
| 115 | + return nil, nil |
| 116 | + } |
| 117 | + return res.(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.InsightsSettingsable), nil |
| 118 | +} |
| 119 | +// ToDeleteRequestInformation delete navigation property itemInsights for admin |
| 120 | +// returns a *RequestInformation when successful |
| 121 | +func (m *PeopleItemInsightsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *PeopleItemInsightsRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { |
| 122 | + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) |
| 123 | + if requestConfiguration != nil { |
| 124 | + requestInfo.Headers.AddAll(requestConfiguration.Headers) |
| 125 | + requestInfo.AddRequestOptions(requestConfiguration.Options) |
| 126 | + } |
| 127 | + requestInfo.Headers.TryAdd("Accept", "application/json") |
| 128 | + return requestInfo, nil |
| 129 | +} |
| 130 | +// ToGetRequestInformation get the properties of an insightsSettings object to display or return item insights in an organization. To learn how to customize the privacy of item insights in an organization, see Customize item insights privacy in Microsoft Graph. |
| 131 | +// returns a *RequestInformation when successful |
| 132 | +func (m *PeopleItemInsightsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *PeopleItemInsightsRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { |
| 133 | + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) |
| 134 | + if requestConfiguration != nil { |
| 135 | + if requestConfiguration.QueryParameters != nil { |
| 136 | + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) |
| 137 | + } |
| 138 | + requestInfo.Headers.AddAll(requestConfiguration.Headers) |
| 139 | + requestInfo.AddRequestOptions(requestConfiguration.Options) |
| 140 | + } |
| 141 | + requestInfo.Headers.TryAdd("Accept", "application/json") |
| 142 | + return requestInfo, nil |
| 143 | +} |
| 144 | +// ToPatchRequestInformation update privacy settings to display or return the specified type of insights in an organization. Currently, itemInsights is the only supported type of settings. To learn more about customizing insights privacy for your organization, see Customize item insights privacy in Microsoft Graph. |
| 145 | +// returns a *RequestInformation when successful |
| 146 | +func (m *PeopleItemInsightsRequestBuilder) ToPatchRequestInformation(ctx context.Context, body iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.InsightsSettingsable, requestConfiguration *PeopleItemInsightsRequestBuilderPatchRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { |
| 147 | + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) |
| 148 | + if requestConfiguration != nil { |
| 149 | + requestInfo.Headers.AddAll(requestConfiguration.Headers) |
| 150 | + requestInfo.AddRequestOptions(requestConfiguration.Options) |
| 151 | + } |
| 152 | + requestInfo.Headers.TryAdd("Accept", "application/json") |
| 153 | + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) |
| 154 | + if err != nil { |
| 155 | + return nil, err |
| 156 | + } |
| 157 | + return requestInfo, nil |
| 158 | +} |
| 159 | +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. |
| 160 | +// returns a *PeopleItemInsightsRequestBuilder when successful |
| 161 | +func (m *PeopleItemInsightsRequestBuilder) WithUrl(rawUrl string)(*PeopleItemInsightsRequestBuilder) { |
| 162 | + return NewPeopleItemInsightsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); |
| 163 | +} |
0 commit comments