mirror of
https://github.com/openshift/installer.git
synced 2026-02-06 09:47:02 +01:00
170 lines
12 KiB
Go
170 lines
12 KiB
Go
package groups
|
|
|
|
import (
|
|
"context"
|
|
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
|
|
iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242 "github.com/microsoftgraph/msgraph-sdk-go/models"
|
|
ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors"
|
|
)
|
|
|
|
// GroupsRequestBuilder provides operations to manage the collection of group entities.
|
|
type GroupsRequestBuilder struct {
|
|
// Path parameters for the request
|
|
pathParameters map[string]string
|
|
// The request adapter to use to execute the requests.
|
|
requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter
|
|
// Url template to use to build the URL for the current request builder
|
|
urlTemplate string
|
|
}
|
|
// GroupsRequestBuilderGetQueryParameters list all the groups available in an organization, excluding dynamic distribution groups. To retrieve dynamic distribution groups, use the Exchange admin center. This operation returns by default only a subset of the properties for each group. These default properties are noted in the Properties section. To get properties that are _not_ returned by default, do a GET operation for the group and specify the properties in a `$select` OData query option. The **hasMembersWithLicenseErrors** and **isArchived** properties are an exception and are not returned in the `$select` query.
|
|
type GroupsRequestBuilderGetQueryParameters struct {
|
|
// Include count of items
|
|
Count *bool `uriparametername:"%24count"`
|
|
// Expand related entities
|
|
Expand []string `uriparametername:"%24expand"`
|
|
// Filter items by property values
|
|
Filter *string `uriparametername:"%24filter"`
|
|
// Order items by property values
|
|
Orderby []string `uriparametername:"%24orderby"`
|
|
// Search items by search phrases
|
|
Search *string `uriparametername:"%24search"`
|
|
// Select properties to be returned
|
|
Select []string `uriparametername:"%24select"`
|
|
// Skip the first n items
|
|
Skip *int32 `uriparametername:"%24skip"`
|
|
// Show only the first n items
|
|
Top *int32 `uriparametername:"%24top"`
|
|
}
|
|
// GroupsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options.
|
|
type GroupsRequestBuilderGetRequestConfiguration struct {
|
|
// Request headers
|
|
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders
|
|
// Request options
|
|
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption
|
|
// Request query parameters
|
|
QueryParameters *GroupsRequestBuilderGetQueryParameters
|
|
}
|
|
// GroupsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options.
|
|
type GroupsRequestBuilderPostRequestConfiguration struct {
|
|
// Request headers
|
|
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders
|
|
// Request options
|
|
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption
|
|
}
|
|
// NewGroupsRequestBuilderInternal instantiates a new GroupsRequestBuilder and sets the default values.
|
|
func NewGroupsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GroupsRequestBuilder) {
|
|
m := &GroupsRequestBuilder{
|
|
}
|
|
m.urlTemplate = "{+baseurl}/groups{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}";
|
|
urlTplParams := make(map[string]string)
|
|
for idx, item := range pathParameters {
|
|
urlTplParams[idx] = item
|
|
}
|
|
m.pathParameters = urlTplParams
|
|
m.requestAdapter = requestAdapter
|
|
return m
|
|
}
|
|
// NewGroupsRequestBuilder instantiates a new GroupsRequestBuilder and sets the default values.
|
|
func NewGroupsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GroupsRequestBuilder) {
|
|
urlParams := make(map[string]string)
|
|
urlParams["request-raw-url"] = rawUrl
|
|
return NewGroupsRequestBuilderInternal(urlParams, requestAdapter)
|
|
}
|
|
// Count provides operations to count the resources in the collection.
|
|
func (m *GroupsRequestBuilder) Count()(*CountRequestBuilder) {
|
|
return NewCountRequestBuilderInternal(m.pathParameters, m.requestAdapter)
|
|
}
|
|
// Delta provides operations to call the delta method.
|
|
func (m *GroupsRequestBuilder) Delta()(*DeltaRequestBuilder) {
|
|
return NewDeltaRequestBuilderInternal(m.pathParameters, m.requestAdapter)
|
|
}
|
|
// Get list all the groups available in an organization, excluding dynamic distribution groups. To retrieve dynamic distribution groups, use the Exchange admin center. This operation returns by default only a subset of the properties for each group. These default properties are noted in the Properties section. To get properties that are _not_ returned by default, do a GET operation for the group and specify the properties in a `$select` OData query option. The **hasMembersWithLicenseErrors** and **isArchived** properties are an exception and are not returned in the `$select` query.
|
|
// [Find more info here]
|
|
//
|
|
// [Find more info here]: https://docs.microsoft.com/graph/api/group-list?view=graph-rest-1.0
|
|
func (m *GroupsRequestBuilder) Get(ctx context.Context, requestConfiguration *GroupsRequestBuilderGetRequestConfiguration)(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.GroupCollectionResponseable, error) {
|
|
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {
|
|
"4XX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,
|
|
"5XX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,
|
|
}
|
|
res, err := m.requestAdapter.Send(ctx, requestInfo, iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.CreateGroupCollectionResponseFromDiscriminatorValue, errorMapping)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if res == nil {
|
|
return nil, nil
|
|
}
|
|
return res.(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.GroupCollectionResponseable), nil
|
|
}
|
|
// GetAvailableExtensionProperties provides operations to call the getAvailableExtensionProperties method.
|
|
func (m *GroupsRequestBuilder) GetAvailableExtensionProperties()(*GetAvailableExtensionPropertiesRequestBuilder) {
|
|
return NewGetAvailableExtensionPropertiesRequestBuilderInternal(m.pathParameters, m.requestAdapter)
|
|
}
|
|
// GetByIds provides operations to call the getByIds method.
|
|
func (m *GroupsRequestBuilder) GetByIds()(*GetByIdsRequestBuilder) {
|
|
return NewGetByIdsRequestBuilderInternal(m.pathParameters, m.requestAdapter)
|
|
}
|
|
// Post create a new group as specified in the request body. You can create the following types of groups: This operation returns by default only a subset of the properties for each group. These default properties are noted in the Properties section. To get properties that are _not_ returned by default, do a GET operation and specify the properties in a `$select` OData query option.
|
|
// [Find more info here]
|
|
//
|
|
// [Find more info here]: https://docs.microsoft.com/graph/api/group-post-groups?view=graph-rest-1.0
|
|
func (m *GroupsRequestBuilder) Post(ctx context.Context, body iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.Groupable, requestConfiguration *GroupsRequestBuilderPostRequestConfiguration)(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.Groupable, error) {
|
|
requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration);
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {
|
|
"4XX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,
|
|
"5XX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,
|
|
}
|
|
res, err := m.requestAdapter.Send(ctx, requestInfo, iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.CreateGroupFromDiscriminatorValue, errorMapping)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if res == nil {
|
|
return nil, nil
|
|
}
|
|
return res.(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.Groupable), nil
|
|
}
|
|
// ToGetRequestInformation list all the groups available in an organization, excluding dynamic distribution groups. To retrieve dynamic distribution groups, use the Exchange admin center. This operation returns by default only a subset of the properties for each group. These default properties are noted in the Properties section. To get properties that are _not_ returned by default, do a GET operation for the group and specify the properties in a `$select` OData query option. The **hasMembersWithLicenseErrors** and **isArchived** properties are an exception and are not returned in the `$select` query.
|
|
func (m *GroupsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *GroupsRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
|
|
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()
|
|
requestInfo.UrlTemplate = m.urlTemplate
|
|
requestInfo.PathParameters = m.pathParameters
|
|
requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET
|
|
requestInfo.Headers.Add("Accept", "application/json")
|
|
if requestConfiguration != nil {
|
|
if requestConfiguration.QueryParameters != nil {
|
|
requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters))
|
|
}
|
|
requestInfo.Headers.AddAll(requestConfiguration.Headers)
|
|
requestInfo.AddRequestOptions(requestConfiguration.Options)
|
|
}
|
|
return requestInfo, nil
|
|
}
|
|
// ToPostRequestInformation create a new group as specified in the request body. You can create the following types of groups: This operation returns by default only a subset of the properties for each group. These default properties are noted in the Properties section. To get properties that are _not_ returned by default, do a GET operation and specify the properties in a `$select` OData query option.
|
|
func (m *GroupsRequestBuilder) ToPostRequestInformation(ctx context.Context, body iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.Groupable, requestConfiguration *GroupsRequestBuilderPostRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
|
|
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()
|
|
requestInfo.UrlTemplate = m.urlTemplate
|
|
requestInfo.PathParameters = m.pathParameters
|
|
requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST
|
|
requestInfo.Headers.Add("Accept", "application/json")
|
|
err := requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if requestConfiguration != nil {
|
|
requestInfo.Headers.AddAll(requestConfiguration.Headers)
|
|
requestInfo.AddRequestOptions(requestConfiguration.Options)
|
|
}
|
|
return requestInfo, nil
|
|
}
|
|
// ValidateProperties provides operations to call the validateProperties method.
|
|
func (m *GroupsRequestBuilder) ValidateProperties()(*ValidatePropertiesRequestBuilder) {
|
|
return NewValidatePropertiesRequestBuilderInternal(m.pathParameters, m.requestAdapter)
|
|
}
|