|
| 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 | +// PeoplePronounsRequestBuilder provides operations to manage the pronouns property of the microsoft.graph.peopleAdminSettings entity. |
| 11 | +type PeoplePronounsRequestBuilder struct { |
| 12 | + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder |
| 13 | +} |
| 14 | +// PeoplePronounsRequestBuilderGetQueryParameters get the properties of the pronounsSettings resource for an organization. For more information on settings to manage pronouns support, see Manage pronouns settings for an organization using the Microsoft Graph API. |
| 15 | +type PeoplePronounsRequestBuilderGetQueryParameters struct { |
| 16 | + // Expand related entities |
| 17 | + Expand []string `uriparametername:"%24expand"` |
| 18 | + // Select properties to be returned |
| 19 | + Select []string `uriparametername:"%24select"` |
| 20 | +} |
| 21 | +// PeoplePronounsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. |
| 22 | +type PeoplePronounsRequestBuilderGetRequestConfiguration struct { |
| 23 | + // Request headers |
| 24 | + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders |
| 25 | + // Request options |
| 26 | + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption |
| 27 | + // Request query parameters |
| 28 | + QueryParameters *PeoplePronounsRequestBuilderGetQueryParameters |
| 29 | +} |
| 30 | +// PeoplePronounsRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. |
| 31 | +type PeoplePronounsRequestBuilderPatchRequestConfiguration struct { |
| 32 | + // Request headers |
| 33 | + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders |
| 34 | + // Request options |
| 35 | + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption |
| 36 | +} |
| 37 | +// NewPeoplePronounsRequestBuilderInternal instantiates a new PronounsRequestBuilder and sets the default values. |
| 38 | +func NewPeoplePronounsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PeoplePronounsRequestBuilder) { |
| 39 | + m := &PeoplePronounsRequestBuilder{ |
| 40 | + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/people/pronouns{?%24select,%24expand}", pathParameters), |
| 41 | + } |
| 42 | + return m |
| 43 | +} |
| 44 | +// NewPeoplePronounsRequestBuilder instantiates a new PronounsRequestBuilder and sets the default values. |
| 45 | +func NewPeoplePronounsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PeoplePronounsRequestBuilder) { |
| 46 | + urlParams := make(map[string]string) |
| 47 | + urlParams["request-raw-url"] = rawUrl |
| 48 | + return NewPeoplePronounsRequestBuilderInternal(urlParams, requestAdapter) |
| 49 | +} |
| 50 | +// Get get the properties of the pronounsSettings resource for an organization. For more information on settings to manage pronouns support, see Manage pronouns settings for an organization using the Microsoft Graph API. |
| 51 | +// [Find more info here] |
| 52 | +// |
| 53 | +// [Find more info here]: https://learn.microsoft.com/graph/api/peopleadminsettings-list-pronouns?view=graph-rest-1.0 |
| 54 | +func (m *PeoplePronounsRequestBuilder) Get(ctx context.Context, requestConfiguration *PeoplePronounsRequestBuilderGetRequestConfiguration)(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.PronounsSettingsable, error) { |
| 55 | + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); |
| 56 | + if err != nil { |
| 57 | + return nil, err |
| 58 | + } |
| 59 | + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { |
| 60 | + "4XX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue, |
| 61 | + "5XX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue, |
| 62 | + } |
| 63 | + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.CreatePronounsSettingsFromDiscriminatorValue, errorMapping) |
| 64 | + if err != nil { |
| 65 | + return nil, err |
| 66 | + } |
| 67 | + if res == nil { |
| 68 | + return nil, nil |
| 69 | + } |
| 70 | + return res.(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.PronounsSettingsable), nil |
| 71 | +} |
| 72 | +// Patch update the properties of a pronounsSettings object in an organization. For more information on settings to manage pronouns support, see Manage pronouns settings for an organization using the Microsoft Graph API. |
| 73 | +// [Find more info here] |
| 74 | +// |
| 75 | +// [Find more info here]: https://learn.microsoft.com/graph/api/pronounssettings-update?view=graph-rest-1.0 |
| 76 | +func (m *PeoplePronounsRequestBuilder) Patch(ctx context.Context, body iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.PronounsSettingsable, requestConfiguration *PeoplePronounsRequestBuilderPatchRequestConfiguration)(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.PronounsSettingsable, error) { |
| 77 | + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); |
| 78 | + if err != nil { |
| 79 | + return nil, err |
| 80 | + } |
| 81 | + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { |
| 82 | + "4XX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue, |
| 83 | + "5XX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue, |
| 84 | + } |
| 85 | + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.CreatePronounsSettingsFromDiscriminatorValue, errorMapping) |
| 86 | + if err != nil { |
| 87 | + return nil, err |
| 88 | + } |
| 89 | + if res == nil { |
| 90 | + return nil, nil |
| 91 | + } |
| 92 | + return res.(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.PronounsSettingsable), nil |
| 93 | +} |
| 94 | +// ToGetRequestInformation get the properties of the pronounsSettings resource for an organization. For more information on settings to manage pronouns support, see Manage pronouns settings for an organization using the Microsoft Graph API. |
| 95 | +func (m *PeoplePronounsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *PeoplePronounsRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { |
| 96 | + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) |
| 97 | + if requestConfiguration != nil { |
| 98 | + if requestConfiguration.QueryParameters != nil { |
| 99 | + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) |
| 100 | + } |
| 101 | + requestInfo.Headers.AddAll(requestConfiguration.Headers) |
| 102 | + requestInfo.AddRequestOptions(requestConfiguration.Options) |
| 103 | + } |
| 104 | + requestInfo.Headers.TryAdd("Accept", "application/json") |
| 105 | + return requestInfo, nil |
| 106 | +} |
| 107 | +// ToPatchRequestInformation update the properties of a pronounsSettings object in an organization. For more information on settings to manage pronouns support, see Manage pronouns settings for an organization using the Microsoft Graph API. |
| 108 | +func (m *PeoplePronounsRequestBuilder) ToPatchRequestInformation(ctx context.Context, body iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.PronounsSettingsable, requestConfiguration *PeoplePronounsRequestBuilderPatchRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { |
| 109 | + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) |
| 110 | + if requestConfiguration != nil { |
| 111 | + requestInfo.Headers.AddAll(requestConfiguration.Headers) |
| 112 | + requestInfo.AddRequestOptions(requestConfiguration.Options) |
| 113 | + } |
| 114 | + requestInfo.Headers.TryAdd("Accept", "application/json") |
| 115 | + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) |
| 116 | + if err != nil { |
| 117 | + return nil, err |
| 118 | + } |
| 119 | + return requestInfo, nil |
| 120 | +} |
| 121 | +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. |
| 122 | +func (m *PeoplePronounsRequestBuilder) WithUrl(rawUrl string)(*PeoplePronounsRequestBuilder) { |
| 123 | + return NewPeoplePronounsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); |
| 124 | +} |
0 commit comments